当前位置: 技术问答>linux和unix
在linux下如何实现文件夹的遍历?
来源: 互联网 发布时间:2015-11-17
本文导语: 需要什么函数呢? | #include #include #include #include void dir_scan(char *path, char *file); int count = 0; int main(int argc, char *argv[]) { struct stat s; if(argc != 2){ ...
需要什么函数呢?
|
#include
#include
#include
#include
void dir_scan(char *path, char *file);
int count = 0;
int main(int argc, char *argv[])
{
struct stat s;
if(argc != 2){
printf("one direction requriedn");
exit(1);
}
if(lstat(argv[1], &s) d_name, &buf) d_name);
}
}
closedir(dp);
// exit(0);
}
#include
#include
#include
void dir_scan(char *path, char *file);
int count = 0;
int main(int argc, char *argv[])
{
struct stat s;
if(argc != 2){
printf("one direction requriedn");
exit(1);
}
if(lstat(argv[1], &s) d_name, &buf) d_name);
}
}
closedir(dp);
// exit(0);
}
|
呵,用递归不就行了吗?