mirror of
https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator.git
synced 2025-04-25 14:15:58 +09:00
fix(flatmap): create output file if it doesn't exist
This commit is contained in:
parent
b492d097e7
commit
2accbc3910
1 changed files with 5 additions and 1 deletions
|
@ -99,7 +99,11 @@ pub fn generate_flatmap(xml: &path::Path, out: Option<&path::Path>) -> Result<()
|
||||||
}
|
}
|
||||||
let f: Box<dyn Write> = match out {
|
let f: Box<dyn Write> = match out {
|
||||||
Some(f) => {
|
Some(f) => {
|
||||||
let file = File::options().write(true).truncate(true).open(f)?;
|
let file = File::options()
|
||||||
|
.create(true)
|
||||||
|
.write(true)
|
||||||
|
.truncate(true)
|
||||||
|
.open(f)?;
|
||||||
Box::new(BufWriter::new(file))
|
Box::new(BufWriter::new(file))
|
||||||
}
|
}
|
||||||
None => Box::new(io::stdout()),
|
None => Box::new(io::stdout()),
|
||||||
|
|
Loading…
Add table
Reference in a new issue