I need to list all files in a folder (including sub-folder,
recursively), and I tried some sample codes in GNU C manual, as
follows:
...
The sample was working. Then I added some codes to check the
ep->d_type (the type of the file). If it was a directory, the
program would check the sub-folder recursively. However, I
encountered a compiler error. The property d_type was not defined
in the Cygwin header file dirent.h. It seems that we cannot
distinguish the files from the directories. Is that true? Doesn't
anybody have a good idea to do this?
Thank you very much in adavance!