Question

I'm writing a program that searches through the entire file system by file name and file contents (plain text). Is there any algorithm or open source project that could make the search very fast? I'm doing this on Windows with FAT/NTFS file systems and I don't want indexing.

Was it helpful?

Solution

Downloaded a NTFS searcher (named NTFS-Search) on SourceForce and it does the job very well! It first reads the 'FAT'once and after that it is incredibly fast. Only the interface is in German.

You can download the source with SVN:

svn co https://ntfs-search.svn.sourceforge.net/svnroot/ntfs-search 

OTHER TIPS

If you're only searching by file name / file attributes / file date, the "magic" method to have the best performances is to manually "parse" the File Allocation Table (if filesystem is FAT) and the Master File Table (if filesystem is NTFS).

It's not too hard for the FAT filesystem as it's quite simple and well documented, but it's more difficult for NTFS, as the filesystem is much more complicated and not-so-well documented.

If you also want to search for file content, then there is no way but enumerating all files the reading through their content. You'll always be limited by the disk read speed, you can't optimize that without indexing file content.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top