Crate blkmap

Crate blkmap 

Source
Expand description

§blkmap

Query file physical extents (FIEMAP) for a given range on disk.

This crate provides a Rust interface to the Linux FIEMAP ioctl, which allows querying the physical block mapping of files on disk.

§Example

use blkmap::Fiemap;
use std::fs::File;

let file = File::open("/path/to/file").unwrap();
let extents = file.fiemap().unwrap();
for extent in extents {
    println!("{:?}", extent);
}

§Features

  • Query full file extent mapping
  • Query extent mapping for a specific byte range
  • Works on both x86 and ARM Linux platforms
  • Bitflags for extent properties (shared, encoded, encrypted, etc.)

Structs§

ExtentFlags
Flags describing the properties of a file extent.
FiemapExtent
A single extent in a file’s physical block mapping.

Traits§

Fiemap
A trait for querying file extent maps (FIEMAP).

Type Aliases§

Result
Result type for blkmap operations.