INNER CODE UNIT · Rust
truncate_file_bytes
openebs/mayastor · io-engine-tests/src/lib.rs:192
pub fn truncate_file_bytes(path: &str, size: u64) {
let output = Command::new("truncate")
.args(["-s", &format!("{size}"), path])
.output()
.expect("failed exec truncate");
assert!(output.status.success(), "{:#?}", output);
}
pub fn expand_tempfs_file_bytes(path: &str, size: u64) {
let output = Command::new("truncate")
.args(["-s", &format!("+{size}"), path])
.output()
.expect("failed exec truncate");
assert!(output.status.success(), "{:#?}", output);
}
/// Automatically assign a loopdev to path
pub fn setup_loopdev_file(path: &str, sector_size: Option<u64>) -> String {