pub fn write_file_atomic(path: impl AsRef<Path>, body: &str) -> Result<()>Expand description
Atomically replace a file with fsynced contents.
The data is written to a sibling temp file, fsynced, renamed over the destination, then the parent directory is fsynced.