Skip to main content

atomic_write

Function atomic_write 

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

Write contents to path atomically (temp file + rename) so a concurrent reader never observes a truncated/empty file, only the old or new contents.