diff --git a/src/node.rs b/src/node.rs index d3d7eff..4356ca7 100644 --- a/src/node.rs +++ b/src/node.rs @@ -219,6 +219,12 @@ impl Node { } self.name.clone() }; + let p = PathBuf::from(&path); + if let Some(parent) = p.parent() { + if !parent.exists() { + self.mkdir(&parent)?; + } + } match self.filetype { FileType::Eof => {} FileType::Fifo => {