blkpg

Crates.ioblkpg
lib.rsblkpg
version0.1.1
sourcesrc
created_at2024-09-21 05:55:48.183595
updated_at2024-09-21 05:55:48.183595
descriptionA library to call Linux blkpg ioctls.
homepage
repositoryhttps://github.com/cloudboss/blkpg
max_upload_size
id1381959
size5,910
rust-team (github:ensicoindevs:rust-team)

documentation

README

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(())
}
Commit count: 5

cargo fmt