write_atomic

Function write_atomic 

Source
pub fn write_atomic(path: &Path, bytes: &[u8]) -> Result<()>
Expand description

Write bytes to path atomically: sibling temp file → fsync → rename over the target. Rename is atomic on every supported filesystem when source and destination live on the same volume, which is guaranteed here (sibling temp).