Skip to main content

atomic_write

Function atomic_write 

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

Write content to path atomically.

Writes to a sibling .tmp file first, then renames. On Unix, rename() is atomic within the same filesystem, so the target file is either the old version or the new one — never a partial write.