Skip to main content

write_atomic

Function write_atomic 

Source
pub fn write_atomic(path: &Path, bytes: &[u8]) -> Result<(), WriteError<Error>>
Expand description

Install bytes as the complete contents of path.

The bytes go to a temporary sibling that is flushed to disk and then renamed onto path, so a concurrent reader sees either the old file or the whole new one. path’s parent directory must already exist.