pub fn atomic_write(path: &Path, content: &[u8]) -> Result<()>Expand description
Write content to path atomically.
Writes to a uniquely-named sibling temp 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. The unique temp name prevents concurrent writers
from clobbering each other’s temp files.