03-18-2023, 10:31 AM
(03-18-2023, 08:56 AM)Petr Wrote: But there is one more question. *.* should list folders and subdirectories if I remember correctly. Command$ won't do that. Is there a trick to get those subdirectories out of it? If it doesn't work out like this, I'll take a different approach, I'm just asking. I am working on upgrading my PMF2 program.
It will have to be done the "direntry.h" way. (The original C header file on Linux is called "dirent.h".) I'm not familiar with it but there should be a field in the structure which helps the programmer tell if the file is a "regular" file or if it's a directory. If it's a directory then you'll have to get another list of files for that directory. It's best to keep track of directories into a string array, as they are found and, after one directory is processed for the file names it has, take it out of the array.
Might want to look at this:
https://qb64phoenix.com/forum/showthread.php?tid=68
Understandably, "*.*" is limited only to the current directory because if could involve thousands of files in subdirectories, and this could choke certain command-line programs and other programs which are not well-written.