Skip to main content

write_atomic_private

Function write_atomic_private 

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

Atomically replace a private config file. The temp is created with O_EXCL and mode 0600 in the same directory, then renamed over the target. Renaming replaces a planted symlink instead of following it (on Unix); on Windows a pre-existing symlink is removed first, never followed.