Skip to main content

atomic_write

Function atomic_write 

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

Replace dest with bytes atomically and durably: temp file, sync_all, rename, then sync_all on the directory (Unix). On failure the temp file is removed and dest is untouched.

ยงErrors

Any I/O error along the way.