From b070a129f8e0c612f8f41c88a07c2cf081f94f7e Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Mon, 10 Jul 2023 09:47:36 -0400 Subject: [PATCH] Ensure parent directory exists before attempting to extract files --- src/node.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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 => {