Skip to main content

atomic_write

Function atomic_write 

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

Atomically write content to a file via a temporary file and rename.

Resolves symlinks at the target path before persisting so the rename writes through to the symlink’s target file rather than replacing the symlink itself with a regular file (common when configs are mounted into containers via symlinks).