Linux 下周遊所有目錄下的檔案
//#include<dirent.h>
DIR* dir = opendir("/home/liu/Desktop/C++/test7/txt");
dirent* p = NULL;
while((p = readdir(dir))!=NULL){
if (p->d_name[0] != '.'){
string name = "/home/liu/Desktop/C++/test7/txt/"+string(p->d_name);
cout<<name<<endl;
}
}
closedir(dir);