diff --git a/src/pxar/sequential_decoder.rs b/src/pxar/sequential_decoder.rs index 79c0adce..e3826188 100644 --- a/src/pxar/sequential_decoder.rs +++ b/src/pxar/sequential_decoder.rs @@ -724,7 +724,8 @@ impl Result<(), Error>> SequentialDecoder { /// /// The directory is created if it does not exist. pub fn restore(&mut self, path: &Path, match_pattern: &[MatchPattern]) -> Result<(), Error> { - let _ = std::fs::create_dir(path); + std::fs::create_dir_all(path) + .map_err(|err| format_err!("error while creating directory {:?} - {}", path, err))?; let dir = nix::dir::Dir::open( path,