pub fn atomic_write(path: &Path, content: &str) -> SyncResult<()>Expand description
Write content to a file atomically.
This function:
- Writes content to a temporary file (same path with
.tmpextension) - Calls
fsyncto ensure data is on disk - Atomically renames the temp file to the target path
If any step fails, the original file (if any) remains untouched.
ยงErrors
Returns an error if any file operation fails.