pub fn sync_dir(dir: &Path) -> Result<()>Expand description
Flushes dir’s own metadata, making renames into it durable.
Call after the rename that installs a staged file: the directory
entry it created needs a separate flush to reach disk. Skipping this
keeps the atomicity guarantee and loses only durability, to a power cut.
§Platforms
Unix only. A no-op on Windows: as durable as NTFS makes it.
§Errors
std::io::Errorifdircould not be opened or flushed.EINVALis tolerated as “no such step”; never errors on Windows.