9 releases

0.4.2 Feb 15, 2025
0.4.1 Jul 22, 2024
0.4.0 Mar 31, 2024
0.3.0 Jan 13, 2024
0.1.3 Nov 10, 2022

#446 in Filesystem

Download history 24/week @ 2024-12-09 4/week @ 2024-12-16 5/week @ 2025-02-03 106/week @ 2025-02-10 33/week @ 2025-02-17 6/week @ 2025-02-24 4/week @ 2025-03-03

83 downloads per month
Used in verifile

MIT/Apache

68KB
1.5K SLoC

ntfs-reader

crates.io docs.rs license: MIT OR Apache-2.0

Features

  • Fast in-memory scan of all records in the $MFT
  • Usn journal reader

MFT Usage

// Open the C volume and its MFT.
// Must have elevated privileges or it will fail.
let volume = Volume::new("\\\\.\\C:")?;
let mft = Mft::new(volume)?;

// Iterate all files
mft.iterate_files(|file| {
    // Can also use FileInfo::with_cache().
    let info = FileInfo::new(mft, file);

    // Available fields: name, path, is_directory, size, timestamps (created, accessed, modified).
});

// 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 = Volume::new("\\\\?\\C:")?;

// 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 journal = Journal::new(volume, JournalOptions::default())?;

// Try to read some events.
// You can call `read_sized` to use a custom buffer size.
for result in journal.read()? {
    // Available fields are: usn, timestamp, file_id, parent_id, reason, path.
}

Dependencies

~125MB
~2M SLoC