mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-27 08:08:15 -05:00
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,11 @@ use std::{
|
||||
ops::Range,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
// Windows specific extension for std::fs
|
||||
#[cfg(windows)]
|
||||
use std::os::windows::prelude::OpenOptionsExt;
|
||||
|
||||
use tracing::*;
|
||||
|
||||
pub mod compression;
|
||||
@@ -261,6 +266,16 @@ impl<H: NippyJarHeader> NippyJar<H> {
|
||||
|
||||
// fsync() dir
|
||||
if let Some(parent) = tmp_path.parent() {
|
||||
//custom_flags() is only available on Windows
|
||||
#[cfg(windows)]
|
||||
OpenOptions::new()
|
||||
.read(true)
|
||||
.write(true)
|
||||
.custom_flags(0x02000000) // FILE_FLAG_BACKUP_SEMANTICS
|
||||
.open(parent)?
|
||||
.sync_all()?;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
OpenOptions::new().read(true).open(parent)?.sync_all()?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user