Add remove_dir_all()

This commit is contained in:
Damien Elmes 2023-11-22 14:02:04 +10:00
parent a9d73fc3be
commit 60c3bc8d37

View File

@ -54,6 +54,15 @@ pub fn remove_file(path: impl AsRef<Path>) -> Result<()> {
})
}
/// See [std::fs::remove_dir_all].
#[allow(dead_code)]
pub fn remove_dir_all(path: impl AsRef<Path>) -> Result<()> {
std::fs::remove_dir_all(&path).context(FileIoSnafu {
path: path.as_ref(),
op: FileOp::Remove,
})
}
/// See [std::fs::create_dir].
pub fn create_dir(path: impl AsRef<Path>) -> Result<()> {
std::fs::create_dir(&path).context(FileIoSnafu {