Skip to main content

atomic_write

Function atomic_write 

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

Atomically replace path with contents: sibling .lock temp, write, rename. Fails when the lock already exists; callers create parent directories themselves when needed.