atomic-write-file
Write files atomically to a file system
0.3.1
5.2M downloads/mo
#4461 most downloaded on crates.io
andreacorbellini/rust-atomic-write-file
What this package is like to depend on
Last release 12 days ago
11 Aug 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 11 of 11 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
11 releases · first in 2023
2 releases in the last 12 months
see the full history below
Release timeline
11 releases · Aug 2023 to Aug 2026Releases
latest 11-
0.3.111 Aug 2026Release notes
Open source →- Updated dependency on
randto version 0.10 (contributed by thehouseisonfire).
Unix changes
- Updated dependency on
nixto version 0.31 (contributed by thehouseisonfire).
- Updated dependency on
-
0.3.011 Sep 2025Release notes
Open source →Unix changes
- Updated dependency on
nixto version 0.30.
Breaking changes
-
Changed Rust edition from 2021 to 2024.
-
Explicitly set the MSRV to 0.85 (the first Rust version to support the 2024 edition).
Release notes
Open source →- Updated dependency on
randto version 0.10 (contributed by thehouseisonfire).
Unix changes
- Updated dependency on
nixto version 0.31 (contributed by thehouseisonfire).
- Updated dependency on
-
0.2.327 Jan 2025Release notes
Open source →- Fixed documentation to state that
discard()(notcommit()) is called on drop (contributed by Lucy).
Release notes
Open source →- Fixed documentation to state that
discard()(notcommit()) is called on drop (contributed by Lucy).
- Fixed documentation to state that
-
0.2.203 Nov 2024Release notes
Open source →Unix changes
- Fixed a build error with
androideabi(contributed by xuxiaocheng0201).
Release notes
Open source →Unix changes
- Fixed a build error with
androideabi(contributed by xuxiaocheng0201).
- Fixed a build error with
-
0.2.123 Sep 2024 -
0.2.023 Sep 2024Release notes
Open source →New features
- Added the
AtomicWriteFile::directorymethod to allow accessing the file descriptor of the parent directory, without making any system call (this method is available on all platforms, but it has a meaningful implementation only on Unix).
Unix changes
-
Updated dependency on
nixto version 0.29. -
Sync the parent directory after committing or discarding the temporary file (via
fsync(2)). This ensures that changes are persisted and not rolled-back if a crash occurs.In the previous releases, syncing the directory was intended to be a step that had to be explicitly performed by the caller if they wanted this behavior, and it was intentionally left out as a performance improvement for those callers that did not care about changes being persisted. However we do realize that callers may not be aware of the importance of this step, hence now it's done automatically.
Breaking changes
- The
unnamed-tmpfileis now disabled by default and needs to be explicitly enabled withfeatures = ["unnamed-tmpfile"]inCargo.toml. This decision was made to better support processes that run early at boot, and filesystems that have poor support for anonymous temporary files.
Release notes
Open source →New features
- Added the
AtomicWriteFile::directorymethod to allow accessing the file descriptor of the parent directory, without making any system call (this method is available on all platforms, but it has a meaningful implementation only on Unix).
Unix changes
-
Updated dependency on
nixto version 0.29. -
Sync the parent directory after committing or discarding the temporary file (via
fsync(2)). This ensures that changes are persisted and not rolled-back if a crash occurs.In the previous releases, syncing the directory was intended to be a step that had to be explicitly performed by the caller if they wanted this behavior, and it was intentionally left out as a performance improvement for those callers that did not care about changes being persisted. However we do realize that callers may not be aware of the importance of this step, hence now it's done automatically.
Breaking changes
- The
unnamed-tmpfileis now disabled by default and needs to be explicitly enabled withfeatures = ["unnamed-tmpfile"]inCargo.toml. This decision was made to better support processes that run early at boot, and filesystems that have poor support for anonymous temporary files.
- Added the
-
0.1.425 Apr 2024Release notes
Open source →Linux changes
- Fix a potential data loss problem with anonymous temporary files on btrfs (see GitHub issue #6 for details).
Release notes
Open source →Linux changes
- Fix a potential data loss problem with anonymous temporary files on btrfs (see GitHub issue #6 for details).
-
0.1.301 Mar 2024Release notes
Open source →Unix changes
- Update dependency on
nixto version 0.28. This improves compatibility with Illumos, Solaris, and Solaris-like operating systems. (contributed by Rain).
Release notes
Open source →Unix changes
- Update dependency on
nixto version 0.28. This improves compatibility with Illumos, Solaris, and Solaris-like operating systems. (contributed by Rain).
- Update dependency on
-
0.1.230 Nov 2023Release notes
Open source →Linux changes
- Detect whether anonymous temporary files are supported or not, and automatically fall back to named temporary files in case they're not.
Release notes
Open source →Linux changes
- Detect whether anonymous temporary files are supported or not, and automatically fall back to named temporary files in case they're not.
-
0.1.128 Nov 2023Release notes
Open source →Unix changes
- Update dependency on
nixto version 0.27 (contributed by messense).
Release notes
Open source →Unix changes
- Update dependency on
nixto version 0.27 (contributed by messense).
- Update dependency on
-
0.1.022 Aug 2023