Skip to main content

replace

Function replace 

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

Writes contents to path, replacing any file there, atomically: a rename of a synced temporary file, so a reader sees the old contents or the new, never part of either. Parent directories are created.

§Errors

The filesystem’s error; the temporary file is removed then.