View Full Version : loading ALL files in a dir

01-10-2003, 09:06 AM
Alright, so i make a loader.. it loads in .dan files (.ase converted to my own file format)... i want to, when i start a program, have the program find ALL the .dan files in its directory, and then load each of them into its database... how can i get C++ to look through its dir, and open each file that ends with .dan?

01-10-2003, 09:11 AM
If you are working on Win32, I believe you can use a combination of FindFirstFile and FindNextFile to search a directory for a filename (which I believe can include wildcards).

01-10-2003, 09:26 AM
i dont exactly know how to use those... can u gimme an example code?

Stack Overflow
01-10-2003, 11:02 AM
You can check out msdn:

FindFirstFile (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/findfirstfile.asp)