pub fn atomic_write(path: &Path, data: &[u8]) -> Result<()>
Atomically write data to path by writing to a temp file first, then renaming. This prevents partial writes from corrupting the target file.
data
path