How to count no. of folders in a directory?
-
Yes, you may. I have 10 fingers and 10 toes. What are you working with?
I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
-
You could use FindFirstFile()/FindNextFile() and count only files with the FILE_ATTRIBUTE_DIRECTORY attribute. The code could be similar to this[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
int iCountDir=0; BOOL bWorkingff = Finderff.FindFile("*.*"); bWorkingff = Finderff.FindNextFile(); while(bWorkingff) { if (Finderff.IsDirectory()==TRUE) iCountDir++; bWorkingff = Finderff.FindNextFile(); } Finderff.Close() // iCountDir --Use it now
-
See DlgDirList.
-
See DlgDirList.
Hamid. wrote:
DlgDirList
does that return no of Directory in the folder?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You