From: Valentine Wallace Date: Wed, 17 Feb 2021 02:09:52 +0000 (-0500) Subject: set dir readonly false X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=4fcc3a396a3fd32549c897ebc9877b00e13f734a;p=rust-lightning set dir readonly false --- diff --git a/lightning-persister/src/util.rs b/lightning-persister/src/util.rs index 1de34055b..681c28b07 100644 --- a/lightning-persister/src/util.rs +++ b/lightning-persister/src/util.rs @@ -81,6 +81,8 @@ pub(crate) fn write_to_file(path: String, filename: String, da } #[cfg(target_os = "windows")] { + let mut dir_perms = fs::metadata(path.clone()).unwrap().permissions(); + dir_perms.set_readonly(false); if let Ok(metadata) = fs::metadata(filename_with_path.clone()) { let mut perms = metadata.permissions(); perms.set_readonly(false);