From: Valentine Wallace Date: Wed, 17 Feb 2021 02:06:54 +0000 (-0500) Subject: print all the perms X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=750ce4cc2bf06b9a115a93f2c3c4344f361b82dd;p=rust-lightning print all the perms --- diff --git a/lightning-persister/src/util.rs b/lightning-persister/src/util.rs index 79b11bb67..1de34055b 100644 --- a/lightning-persister/src/util.rs +++ b/lightning-persister/src/util.rs @@ -44,10 +44,13 @@ pub(crate) fn write_to_file(path: String, filename: String, da println!("VMW: created dir"); println!("VMW: entries in dir:"); + let mut dir_perms = fs::metadata(path.clone()).unwrap().permissions(); + println!("VMW: dir perms: {:?}", dir_perms); let dir = PathBuf::from(path.clone()); for entry in fs::read_dir(dir).unwrap() { let entry = entry.unwrap(); - println!("VMW: entry in dir: {:?}", entry.path()); + let metadata = entry.metadata().unwrap(); + println!("VMW: entry in dir: {:?}, perms in entry: {:?}", entry.path(), metadata.permissions()); } // Do a crazy dance with lots of fsync()s to be overly cautious here... // We never want to end up in a state where we've lost the old data, or end up using the