pub fn write_atomic<P: AsRef<Path>, C: AsRef<[u8]>>(
path: P,
contents: C,
) -> Result<()>
Expand description
Writes a file to disk atomically.
This uses tempfile::persist
to accomplish atomic writes.
If the path is a symlink, it will follow the symlink and write to the actual target.