PDA

View Full Version : loading ALL files in a dir



ImpactDNI
01-10-2003, 10: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?

T
01-10-2003, 10: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).

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

Stack Overflow
01-10-2003, 12:02 PM
You can check out msdn:

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

- VC6-OGL