linux下c语言实现搜索根目录下所有文件
linux下c语言实现搜索根目录下所有文件 头文件: #include<dirent.h> #include<sys/types.h> opendir(): 函数原型: DIR * opendir(const char* path); 打开一个目录,在失败的时候返回NULL(如果path对应的是文件,则返回NULL) DIR 结构体的原型为:struct_dirstream 在linux系统中: typedef struct __dirstream DIR; struct __dirstream { void *__fd; /* `struct hurd_fd' pointer for descriptor. */ char *__data; /* Directory block. */ int __entry_data; /* Entry number `__data' corresponds to. */ char *__ptr; /* Current pointer into the block. */ int __entry_ptr; /* Entry number `__ptr' corresponds to. */ size_t __allocation; /* Space allocated for the block. */ size_t __size; /*