features = ["bitcoinconsensus"]
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3", features = ["winbase"] }
+winapi = { version = "0.3", features = ["winbase", "fileapi"] }
[dev-dependencies]
lightning = { version = "0.0.12", path = "../lightning", features = ["_test_utils"] }
#[cfg(target_os = "windows")]
extern crate winapi;
+#[cfg(target_os = "windows")]
+use std::os::windows::io::IntoRawHandle;
use std::fs;
use std::path::{Path, PathBuf};
)});
}
let mut final_file = fs::File::open(filename_with_path.clone())?;
- final_file.sync_all()?;
+ let file_handle = final_file.into_raw_handle();
+ unsafe{winapi::um::fileapi::FlushFileBuffers(file_handle);}
+ // final_file.sync_all()?;
println!("VMW: renamed");
}
Ok(())