当前位置: 技术问答>linux和unix
如何在linux下用c/c++边编程实现文件夹下所有子目录文件的遍历?
来源: 互联网 发布时间:2015-11-03
本文导语: 大家可以讨论一下 | #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)
#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)