Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get list of folders in this folder?

How to get list of folders in this folder?

like image 577
SomeUser Avatar asked Feb 10 '10 19:02

SomeUser


People also ask

Is there a way to get a list of files in a folder?

Press and hold the SHIFT key and then right-click the folder that contains the files you need listed. Click Open command window here on the new menu. A new window with white text on a black background should appear. o To the left of the blinking cursor you will see the folder path you selected in the previous step.

How do I get a list of files in a folder Windows 10?

Select all the files, press and hold the shift key, then right-click and select Copy as path. This copies the list of file names to the clipboard. Paste the results into any document such as a txt or doc file & print that. Then open notepad, open tempfilename, and print it from there.


1 Answers

FindFirstFileEx+FindExSearchLimitToDirectories.

WIN32_FIND_DATA fi;
HANDLE h = FindFirstFileEx(
        dir,
        FindExInfoStandard,
        &fi,
        FindExSearchLimitToDirectories,
        NULL,
        0);
if (h != INVALID_HANDLE_VALUE) {
    do {
        if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 
            printf("%s\n", fi.cFileName);
    } while (FindNextFile(h, &fi));
    FindClose(h);
}
like image 64
ephemient Avatar answered Sep 29 '22 15:09

ephemient