NtfsLib
NtfsLib copied to clipboard
List all directories/files
Hi,
I'm trying to list all directories & files from my C drive, but it's only give me the first level.
how can I use dir.ListFiles()
to list all files from all directories in my C drive.
I tried a classic recursive method but I think that it's not the fastest way. Is there a native way to do that reading MFT with this library?
Thanks
NTFS does not support any form of recursive lookups like the Win32 API does. So you'll have to do your own recursion.. (It might be that there is a helper in DiscUtils that can do recursion on any implemented filesystem .. it would seem likely).
What do you mean with "the fastest way" ?
Thanks for your reply.
What do you mean with "the fastest way" ?
I'm trying to list more than 3M files in less than 2 minutes, as Ultrasearch do it using MFT. I tried NTFSReader, it worked but when I tried it on a GPT disk I had an error, and NTFSReader is no longer maintained unfortunately.
Have you got an idea?
Thanks
To do stuff like that, I've iterated all MFT entries in one linear go, and then stitched them together after the fact. This is the fastest, as it moves all operations to in-memory datastructures.
One of the two, I believe it's ~NTFSReader~ NTFSParser, is forward-only, and facilitates this.