Posted August 28, 200519 yr Is there anyway to get the names of all the files in a specified directory, in c++?
August 28, 200519 yr The only way i can think of real quick is bruteforcing through all filenames. I know how to do it in assembly (.com file only, since it requires interrupts).
September 3, 200519 yr Or you can use FindFirstFile and FindNextFile somthing like: WIN32_FIND_DATA find; HANDLE result; result = FindFirstFile("C:\\myfolder",&find); while (FindNextFile(result, &find) !=0) { cout<<find.cFileName; } You need to include windows.h
September 4, 200519 yr Author Or you can use FindFirstFile and FindNextFile somthing like: WIN32_FIND_DATA find; HANDLE result; result = FindFirstFile("C:\\myfolder",&find); while (FindNextFile(result, &find) !=0) { cout<<find.cFileName; } You need to include windows.h Actually, this is more help, because the other one uses a non-standard library. Thanks!
September 6, 200519 yr Actually, this is more help, because the other one uses a non-standard library. Thanks! You didn't mention which OS you were using. :P
September 7, 200519 yr Author Well come on... I'm not a genius, as you well know. I'm using windows. I'm thinking of switching to Linux, but my brother, who has the CD-Burner refuses to burn me a copy of the debian distribution.