]> git.bitcoin.ninja Git - rust-lightning/commitdiff
set dir readonly false
authorValentine Wallace <vwallace@protonmail.com>
Wed, 17 Feb 2021 02:09:52 +0000 (21:09 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 17 Feb 2021 02:12:01 +0000 (21:12 -0500)
lightning-persister/src/util.rs

index 1de34055bf8cfbb7e8bf3aa4581fe9d5afd39d52..681c28b07118461c704d1b0954974be5c6b3c62d 100644 (file)
@@ -81,6 +81,8 @@ pub(crate) fn write_to_file<D: DiskWriteable>(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);