ntfs-reader
Features
- Fast in-memory scan of all records in the $MFT
- Usn journal reader
Examples
See the examples directory for complete working examples.
MFT Usage
// Open the C volume and its MFT.
// Must have elevated privileges or it will fail.
let volume = new?;
let mft = new?;
// Iterate all files
for file in mft.files
// Some perf comparison
// Type Iteration Drop Total
// No Cache 12.326s 0 12.326s
// HashMap Cache 4.981s 323.150ms 5.305s
// Vec Cache 3.756s 114.670ms 3.871s
Journal Usage
let volume = new?;
// With `JournalOptions` you can customize things like where to start reading
// from (beginning, end, specific point), the mask to use for the events and more.
let mut journal = new?;
// Try to read some events.
// You can call `read_sized` to use a custom buffer size.
for result in journal.read?
Development
On NixOS/Linux, enter the development shell directly or let direnv load it:
# or: direnv allow
The flake includes Rust, both Windows MSVC Rust targets, cargo-xwin, and the
LLVM linker tools. Windows is still required to execute tests that access a raw
NTFS volume.
You can use plain cargo or install mise:
|
Tasks
On Windows these run Cargo natively. On other platforms they enter the Nix development shell and cross-compile for Windows MSVC.