INNER CODE UNIT · Rust
truncate_file
openebs/mayastor · io-engine-tests/src/lib.rs:183
pub fn truncate_file(path: &str, size: u64) {
let output = Command::new("truncate")
.args(["-s", &format!("{}m", size / 1024), path])
.output()
.expect("failed exec truncate");
assert!(output.status.success(), "{:#?}", output);
}
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) {