thin-provisioning-tools/src/shrink/toplevel.rs

24 lines
570 B
Rust
Raw Normal View History

use anyhow::Result;
use std::fs::OpenOptions;
use std::os::unix::fs::OpenOptionsExt;
use crate::shrink::xml;
//---------------------------------------
2020-06-24 18:25:08 +05:30
pub fn shrink(input_file: &str, _output_file: &str) -> Result<()> {
let input = OpenOptions::new()
.read(true)
.write(false)
.custom_flags(libc::O_EXCL)
.open(input_file)?;
2020-06-24 18:25:08 +05:30
// let mut visitor = xml::XmlWriter::new(std::io::stdout());
let mut visitor = xml::NoopVisitor::new();
xml::read(input, &mut visitor)?;
Ok(())
}
//---------------------------------------