Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I quickly enumerate directories on Win32?

Tags:

c++

winapi

I'm trying to speedup directory enumeration in C++, where I'm recursing into subdirectories. I currently have an app which spends 95% of it's time in FindFirst/FindNextFile APIs, and it takes several minutes to enumerate all the files on a given volume. I know it's possible to do this faster because there is an app that does: Everything. It enumerates my entire drive in seconds.

How might I accomplish something like this?

like image 361
Billy ONeal Avatar asked Mar 24 '10 21:03

Billy ONeal


People also ask

How do I enumerate files and folders?

To enumerate directories and files, use methods that return an enumerable collection of directory or file names, or their DirectoryInfo, FileInfo, or FileSystemInfo objects. If you want to search and return only the names of directories or files, use the enumeration methods of the Directory class.

What does it mean to enumerate a file?

Enumeration is defined as the process of extracting user names, machine names, network resources, shares and services from a system.


1 Answers

I realize this is an old post, but there is a project on source forge that does exactly what you are asking and the source code is available.

You can find the project here: NTFS-Search

like image 115
Scott Dillman Avatar answered Sep 20 '22 13:09

Scott Dillman