Quantcast
Channel: Reading MFT
Viewing all articles
Browse latest Browse all 444

Reading MFT

$
0
0

i used the code in the mft scanner project to play around with some stuff and it is stupid fast to bring back a list of files, faster than anything else i have seen. However, it does little good to get a list of 200000 files and then loop thru them looking for things you are interested in (by name, extension, etc) as it negates the speed gain almost entirely.

so my question is, does the API being used to pull the file listing from the MFT support passing in wild cards so i can get, for example, *.jpg files? this is much more useful than a list containing every file and i still have to loop thru it. might as well walk the directories by hand without the API supporting some kind of filtering

 

 

Hi Eric,

You can specify array of file extensions you want to filter in EnumerateVolume()

Hope this helps

cheers

Max

privatevoid cmdRun_Click(object sender, EventArgs e) {
            Dictionary<UInt64, FileNameAndFrn> result;
            Mft mft = new Mft();
            mft.Drive = "C:";

            mft.EnumerateVolume(out result, newstring[] { ".jpg" });

            System.IO.StreamWriter _file = new System.IO.StreamWriter("_files.txt");foreach (KeyValuePair<UInt64, FileNameAndFrn> entry in result) {
                FileNameAndFrn file = (FileNameAndFrn)entry.Value;
                _file.WriteLine(mft.GetFilePath(file.ParentFrn) +Path.DirectorySeparatorChar + file.Name);
            }
            _file.Close();

        }



Viewing all articles
Browse latest Browse all 444

Trending Articles