"Andrew Edwards" <ed*******@spamfreeusa.com> wrote in message
I would much rather eliminate the use of system();
system() is cluntzy. You will hardly ever find it in real code (at least in
a games programming environment).
Maybe you could give me a few pointers on how to do this in standard C.
C has no directory functions in the standard library. This was probably a
bad decison, but was presumably done since some platforms don't have
anything that could be described as a hierarchical filing system.
It is unusual for a non-trivial C program to rely entirely on the standard
library. You don't need to worry too much about using a platform-specific
extension to handle your directory operations. If portability is a concern,
you can isolate the platform-specific code in its own files. Then you
provide an interface to the rest of the program.
eg
char **listdir(char *path)
is your function to list all files in a directory (you will have to make a
decison on sub-directories and special files like UNIX ..).
Then for each platform you write code to list the directory. Under Windows
you use repeated calls to FindNextFile() after setting up FindFirstFile().