#include #include #include #include #include #include #include #include using namespace std; string header1="My All File List"; string header2="

"; string header3="All File List

"; string tableHeader1=""; string tableHeader2=""; string bottom="
file index file name
"; string tableColumn1 = " "; string tableColumn2 = " "; string tableColumn4 = " "; int rootLength = 0; int total = 0; void foreachDir(string dir) { DIR *dp; struct dirent *dirp; struct stat stDirInfo; size_t subLength = dir.length(); string subDir; if (lstat( dir.c_str(), &stDirInfo) == 0) { if (S_ISDIR(stDirInfo.st_mode)) { if ((dp = opendir(dir.c_str())) != NULL) { while ((dirp = readdir(dp)) != NULL) { //files.push_back(string(dirp->d_name)); if (strcmp(dirp->d_name, ".") != 0 && strcmp(dirp->d_name, "..") != 0) { subDir = dir + string("/") + string(dirp->d_name); foreachDir(subDir); } } closedir(dp); } } else { if (S_ISREG(stDirInfo.st_mode)) { subDir = dir.substr(rootLength, subLength - rootLength); //cout<<"file:"<