DIR *opendir(const char *name); 打开目录以获取目录指针
ep: DIR *dirp = oepndir(path); path : 路径名目录
struct dirent *readdir(DIR *dirp);读取目录项
struct dirent *ep = readdir(dirp); dirp : 目录指针
char buf[256] = {0};
getcwd(buf,256); //获取绝对路径,将路径存储到buf里
获取文件的元数据(类型,权限,大小等)用下面的这些函数
int stat(const cahr *path,struct stat *buf);
int fstat(int fd,struct stat *buf);
int lstat(const char *path,struct stat *buf);
path:文件路径 fd: 文件描述符 buf: 属性结构体