pub fn atomic_write(path: &Path, content: &[u8]) -> Result<(), AtomicWriteError>Expand description
Atomically write content to a file.
- Create a temporary file alongside the target path.
- Write all content.
- Flush the stream.
- fsync the file (ensures data hits the disk).
- Rename the temp file to the target path (atomic on Unix).
ยงArguments
path- The final file path to write.content- The bytes to write.