Skip to main content

Crate hadris_ntfs

Crate hadris_ntfs 

Source
Expand description

§hadris-ntfs

A no_std-compatible library for reading NTFS filesystems (read-only).

§Quick Start

use std::fs::File;
use hadris_ntfs::sync::{NtfsFs, NtfsFsReadExt};

let file = File::open("disk.img").unwrap();
let fs = NtfsFs::open(file).unwrap();
let root = fs.root_dir();
let entries = root.entries().unwrap();
for entry in &entries {
    println!("{} ({})", entry.name(), if entry.is_directory() { "dir" } else { "file" });
}

§Feature Flags

FeatureDefaultDescription
stdYesStandard library support (enables alloc)
allocYesHeap allocation without full std
syncYesSynchronous API via hadris-io sync traits
asyncNoAsynchronous API via hadris-io async traits
readYesRead operations (requires alloc)

§Dual Sync/Async Architecture

This crate provides both synchronous and asynchronous APIs through a compile-time code transformation system. The same implementation source is compiled twice:

  • sync module: synchronous API (enabled by the sync feature)
  • async module: asynchronous API (enabled by async feature)

With the default sync and read features, the synchronous API types are re-exported at the crate root for convenience. The std feature does not select an I/O mode.

§Supported Scope

The reader supports validated boot geometry, update-sequence-protected MFT/index records, resident and non-resident unnamed data, sparse runs, initialized-size zero filling, directory index allocation/bitmaps, NTFS filename namespaces, and $UpCase collation.

It does not yet resolve $ATTRIBUTE_LIST extension records, recover from $MFTMirr, decode compressed or encrypted streams, expose named alternate data streams, or interpret reparse points. See the internal compliance matrix in docs/spec-coverage.md.

Re-exports§

pub use error::NtfsError;
pub use error::Result;
pub use sync::*;
pub use raw::*;

Modules§

attr
NTFS attribute parsing, fixup processing, and data run decoding.
error
Error types for the hadris-ntfs crate.
raw
On-disk structures for NTFS filesystems.
sync
Synchronous NTFS filesystem API.