These days in the Win32 game to the Android platform, you need to enter a lot of CPP files, manual copy is slow and error prone, others to the scanning program is written in Java, do not want to use, so they realized a. Spent more time, the key is that the Unix interface is not very familiar with or do not know that there is this thing, and began to think of their own realization completely,. 2 ... ignorant fearless! So the UNIX environment advanced programming to turn over, to get it done. Have time to upload the source to GitHub.
Api:sys/stat.h:int stat (const char *restrictpathname,struct stat *restrict buf); int fstat (int fields,struct stat *buf); int Lstat (const char *restrictpathname,struct stat *restrict buf);d irent.h:static DIR *opendir (const char *dirname); stat IC struct dirent *readdir (DIR *dirp); Returns the next directory entry point for the Dir directory stream, otherwise returns null;static int Closedir (dir *dirp);
Scan catalog Files