| Crates.io | blkpg |
| lib.rs | blkpg |
| version | 0.1.1 |
| created_at | 2024-09-21 05:55:48.183595+00 |
| updated_at | 2024-09-21 05:55:48.183595+00 |
| description | A library to call Linux blkpg ioctls. |
| homepage | |
| repository | https://github.com/cloudboss/blkpg |
| max_upload_size | |
| id | 1381959 |
| size | 5,910 |
A Rust library to call Linux blkpg ioctls.
Note: only the BLKPG_RESIZE_PARTITION operation is implemented.
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(())
}