Skip to content
This repository has been archived by the owner on Nov 28, 2021. It is now read-only.

List all directories/files #2

Open
codustel opened this issue Feb 4, 2019 · 3 comments
Open

List all directories/files #2

codustel opened this issue Feb 4, 2019 · 3 comments

Comments

@codustel
Copy link

codustel commented Feb 4, 2019

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

@LordMike
Copy link
Owner

LordMike commented Feb 4, 2019

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" ?

@codustel
Copy link
Author

codustel commented Feb 6, 2019

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

@LordMike
Copy link
Owner

LordMike commented Feb 6, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants