Is there any way to find what subdirectories a directory has?
Is there any way to find what subdirectories a directory has?
I am against the teaching of evolution in schools. I am also against widespread
literacy and the refrigeration of food.
this is OS/Compiler specific.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
XP/MSVC++
I am against the teaching of evolution in schools. I am also against widespread
literacy and the refrigeration of food.
the typical way is findfirst() findnext().
_findfirst():
http://msdn.microsoft.com/library/de...ndfirsti64.asp
_findnext():
http://msdn.microsoft.com/library/de...indfirsti64asp
_finddata_t + example of use:
http://msdn.microsoft.com/library/de..._functions.asp
BTW: it doesnt use the _A_SUBDIR flag, but it shouldn't be to hard from here.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
Use FindFirstFile
Then use FindNextFile to loop & continue searching the current directoryCode:HANDLE hSearch; WIN32_FIND_DATA fd; hSearch = FindFirstFile("C:\\", &fd);
Each time, examine the fd structCode:FindNextFile(hSearch, &fd);
if(fd->dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
then it's a directory
-Futura