Fast Search On FAT32/NTFS File System

爷,独闯天下 提交于 2019-12-06 16:39:45

问题


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.


回答1:


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 



回答2:


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.



来源:https://stackoverflow.com/questions/11824325/fast-search-on-fat32-ntfs-file-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!