23 releases

Uses new Rust 2024

0.7.0 Jun 1, 2025
0.6.0 Feb 25, 2025
0.5.3 Feb 21, 2025
0.5.2 Nov 28, 2024
0.1.0 Jul 3, 2021

#309 in Filesystem

Download history 544/week @ 2025-06-12 615/week @ 2025-06-19 427/week @ 2025-06-26 474/week @ 2025-07-03 579/week @ 2025-07-10 378/week @ 2025-07-17 330/week @ 2025-07-24 439/week @ 2025-07-31 396/week @ 2025-08-07 435/week @ 2025-08-14 410/week @ 2025-08-21 366/week @ 2025-08-28 395/week @ 2025-09-04 421/week @ 2025-09-11 503/week @ 2025-09-18 432/week @ 2025-09-25

1,814 downloads per month
Used in journal-forwarder

WTFPL license

15KB
212 lines

Write Atomic

docs.rs changelog
crates.io ci deps.rs
license contributions welcome

Write Atomic was originally a stripped-down remake of tempfile-fast, but with the 3.4.0 release of tempfile, it has largely been mooted.

(tempfile now supports Linux optimizations like O_TMPFILE natively.)

That said, one might still enjoy the ergonomic single-shot nature of Write Atomic's write_file and copy_file methods, as well as their permission/ownership-syncing behaviors, and so it lives on!

Examples

// One line is all it takes:
write_atomic::write_file("/path/to/my-file.txt", b"Some data!").unwrap();

Installation

Add write_atomic to your dependencies in Cargo.toml, like:

[dependencies]
write_atomic = "0.6.*"

Dependencies

~2–15MB
~145K SLoC