Skip to main content

write_atomic

Function write_atomic 

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

Writes bytes to target atomically: a temp file in the same directory is fsynced and then renamed over the target, so readers observe either the old or the new file, never a mix.