src/pxar/sequential_decoder.rs: create all directories in target path
Create the full target path and not fail if an intermediate directory does not exist. This is needed in order to restore multiple archives via the catalog, where the target should further contain each archive name as subdir. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
b6ca690095
commit
d3bcc7f261
@ -724,7 +724,8 @@ impl<R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<R, F> {
|
|||||||
///
|
///
|
||||||
/// The directory is created if it does not exist.
|
/// The directory is created if it does not exist.
|
||||||
pub fn restore(&mut self, path: &Path, match_pattern: &[MatchPattern]) -> Result<(), Error> {
|
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(
|
let dir = nix::dir::Dir::open(
|
||||||
path,
|
path,
|
||||||
|
Loading…
Reference in New Issue
Block a user