hi how to find no of files in a folder
-
hi how to find out no of files in a folder of same extension and also i need names of it.i have the path and the extension name . if any one know abt it plz reply:-D
"Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
-
hi how to find out no of files in a folder of same extension and also i need names of it.i have the path and the extension name . if any one know abt it plz reply:-D
"Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
chethu665 wrote:
find out no of files in a folder of same extension and also i need names of it
Have a look at FindFirstFile(), FindNextFile() and WIN32_FIND_DATA
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
hi how to find out no of files in a folder of same extension and also i need names of it.i have the path and the extension name . if any one know abt it plz reply:-D
"Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
int getFileCount() { int count = 0; CFileFind finder; BOOL bWorking = finder.FindFile("*.*"); while (bWorking) { bWorking = finder.FindNextFile(); count ++ } return count; }
'life is like a ten speed bike,most of us having gears we ne never use' ... i want to try those.
-
int getFileCount() { int count = 0; CFileFind finder; BOOL bWorking = finder.FindFile("*.*"); while (bWorking) { bWorking = finder.FindNextFile(); count ++ } return count; }
'life is like a ten speed bike,most of us having gears we ne never use' ... i want to try those.
Oops.. You also need the names.. modify the function to return also the names using finder.GetFileName(). You can pass a pointer to a string array as argument and store the names in that.:)
'life is like a ten speed bike,most of us having gears we ne never use' ... i want to try those.
-
chethu665 wrote:
find out no of files in a folder of same extension and also i need names of it
Have a look at FindFirstFile(), FindNextFile() and WIN32_FIND_DATA
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
And in the end use of
FindClose
:)
WhiteSky
-
hi how to find out no of files in a folder of same extension and also i need names of it.i have the path and the extension name . if any one know abt it plz reply:-D
"Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
:)Hello Reply from Aman Sonny seems correct. You can get the number of file in the varible count used by Aman. To get the name of file excluding extention use finder.getFileTitle() method. Abhijeet
-
hi how to find out no of files in a folder of same extension and also i need names of it.i have the path and the extension name . if any one know abt it plz reply:-D
"Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
;)Hello, Here goes ur full solution. int count = 0; CFileFind finder; CStringArray l_caryFileNames; BOOL bWorking = finder.FindFile("*.*"); while (bWorking) { bWorking = finder.FindNextFile(); l_caryFileNames.Add(finder.GetFileTitle()); count ++; } Abhijeet -- modified at 6:41 Tuesday 19th December, 2006