From 014dc5f9d77afce0629cf624c1d3de96f35c18ca Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 14 Dec 2020 14:11:23 +0100 Subject: [PATCH] tools: add create_run_dir helper Signed-off-by: Wolfgang Bumiller --- src/tools.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tools.rs b/src/tools.rs index ae510fbd..599bbd04 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -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(()) +}