Skip to main content

write_atomic

Function write_atomic 

Source
pub fn write_atomic(dest: &Path, text: &str) -> Result<()>
Expand description

Writes text to dest atomically.

The bytes land in a temp file in the destination directory, then a rename moves the file into place, so a reader never sees a partial artifact. Parent directories are created as needed.