Is there a way to find out the amount of files in a directory?
If so how would I do this?
-Devouring One-
Is there a way to find out the amount of files in a directory?
If so how would I do this?
-Devouring One-
Dev C++
Win XP/2k/98
I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!
He's lean he's keen... He's the spank machine!
One solution is to use FindFirstFile() and FindNextFile() to access all files as you keep count.
Kuphryn
Yeah i figured I could do that.. but then what the actual goal is, is to keep on reading the files in the directory until the last one so I need to know how many files there are before hand....
Thanx anyways
-Devouring One-
Dev C++
Win XP/2k/98
I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!
He's lean he's keen... He's the spank machine!
>>> so I need to know how many files there are before hand..
No. FindNextFile() returns TRUE if it successfully logged a file, when there are no more files left to log, it returns zero, and a call to GetLastError() will return the value ERROR_NO_MORE_FILES.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
So you are saying I could just have it loop for infinity and wait until it reaches the end?
That solves the problem I guess
Thanx
-Devouring One-
Dev C++
Win XP/2k/98
I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!
He's lean he's keen... He's the spank machine!