From 1d501e726be32e983792cdde31afa612d8f88334 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Tue, 16 Feb 2021 21:31:06 -0500 Subject: [PATCH] switch back to fs::rename --- lightning-persister/src/util.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lightning-persister/src/util.rs b/lightning-persister/src/util.rs index a94c7d001..8b24611e5 100644 --- a/lightning-persister/src/util.rs +++ b/lightning-persister/src/util.rs @@ -92,12 +92,13 @@ pub(crate) fn write_to_file(path: String, filename: String, da let mut tmp_perms = fs::metadata(tmp_filename.clone())?.permissions(); tmp_perms.set_readonly(false); println!("VMW: about to rename"); - let src = PathBuf::from(tmp_filename); - let dst = PathBuf::from(filename_with_path); - call!(unsafe {winapi::um::winbase::MoveFileExW( - path_to_windows_str(src).as_ptr(), path_to_windows_str(dst).as_ptr(), - winapi::um::winbase::MOVEFILE_WRITE_THROUGH | winapi::um::winbase::MOVEFILE_REPLACE_EXISTING - )}); + // let src = PathBuf::from(tmp_filename); + // let dst = PathBuf::from(filename_with_path); + fs::rename(&tmp_filename.clone(), &filename_with_path.clone())?; + // call!(unsafe {winapi::um::winbase::MoveFileExW( + // path_to_windows_str(src).as_ptr(), path_to_windows_str(dst).as_ptr(), + // winapi::um::winbase::MOVEFILE_WRITE_THROUGH | winapi::um::winbase::MOVEFILE_REPLACE_EXISTING + // )}); println!("VMW: renamed"); } Ok(()) -- 2.39.5