Fast file scanning mechanism

I want to have a fast file attributes scanning mechanism for all the files in the volume.How i can accomplish this.As per my knowledge reading the on-disk meta data structure would be efficient.Any suggestions ?

NTFS supports the FSCTL_ENUM_USN_DATA request. There is an article on this, “Keeping an Eye on Your NTFS Drives, Part II: Building a Change Journal Application” (http://www.microsoft.com/msj/1099/journal2/journal2.aspx).

For other file systems you might need to enumerate the files in all directories, there might not be a faster way.

Thanks,
Alex.

xxxxx@rediffmail.com wrote:

I want to have a fast file attributes scanning mechanism for all the files in the volume.How i can accomplish this.As per my knowledge reading the on-disk meta data structure would be efficient.

What do you want to learn? The MFT contains the file name and the
attributes for every file on the disk, but not the path. So, you could
learn that there is a file called README.TXT that is read-only, but that
doesn’t tell you in which directory it resides.

So, if you want to answer the question “how many read-only files are on
this disk?”, I believe you could do that just from the MFT. That, of
course, is not very useful. To get tree-type information, you have to
enumerate the directories individually.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.