summaryrefslogtreecommitdiff
path: root/src/fs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs.rs')
-rw-r--r--src/fs.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/fs.rs b/src/fs.rs
index 1b860b057..9748cffab 100644
--- a/src/fs.rs
+++ b/src/fs.rs
@@ -67,15 +67,12 @@ pub fn make_temp_dir(
}
}
-pub fn mkdir(path: &Path, perm: u32) -> std::io::Result<()> {
+pub fn mkdir(path: &Path, perm: u32, recursive: bool) -> std::io::Result<()> {
debug!("mkdir -p {}", path.display());
let mut builder = DirBuilder::new();
- builder.recursive(true);
+ builder.recursive(recursive);
set_dir_permission(&mut builder, perm);
- builder.create(path).or_else(|err| match err.kind() {
- std::io::ErrorKind::AlreadyExists => Ok(()),
- _ => Err(err),
- })
+ builder.create(path)
}
#[cfg(any(unix))]