tools: add create_run_dir helper

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-12-14 14:11:23 +01:00
parent 59e94227af
commit 014dc5f9d7

View File

@ -554,3 +554,12 @@ pub fn compute_file_csum(file: &mut File) -> Result<([u8; 32], u64), Error> {
Ok((csum, size))
}
/// Create the base run-directory.
///
/// This exists to fixate the permissions for the run *base* directory while allowing intermediate
/// directories after it to have different permissions.
pub fn create_run_dir() -> Result<(), Error> {
let _: bool = proxmox::tools::fs::create_path(PROXMOX_BACKUP_RUN_DIR_M!(), None, None)?;
Ok(())
}