blkpg 0.2.0

A library to call Linux blkpg ioctls.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 9.49 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 264.39 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cloudboss/blkpg
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rjosephwright

blkpg

A Rust library to call Linux blkpg ioctls.

Note: only the BLKPG_RESIZE_PARTITION operation is implemented.

Example

use std::fs::File;
use std::io::Error;

use blkpg::resize_partition;

fn main() -> Result<(), Error> {
    let f = File::options()
        .read(true)
        .write(true)
        .open("/dev/nvme0n1")?;
    resize_partition(&f, 2, 456, 789, 512)?;
    Ok(())
}