pub fn replace_file_atomically(path: &Path, body: &str) -> Result<()>Expand description
Replace path with body through a flushed temporary and a rename.
For generated output a reader shares, which is a mirror: a plain write truncates first, so a reader mid-pull, or a crash, sees a half file where a whole one was.
ยงErrors
Returns an error if the parent directory cannot be created, the temporary cannot be written, or the rename cannot publish it.