22 releases

Uses new Rust 2024

0.6.0 Feb 25, 2025
0.5.2 Nov 28, 2024
0.5.0 Oct 5, 2023
0.4.0 Jul 25, 2023
0.1.0 Jul 3, 2021

#302 in Concurrency

Download history 365/week @ 2025-01-11 306/week @ 2025-01-18 286/week @ 2025-01-25 997/week @ 2025-02-01 349/week @ 2025-02-08 436/week @ 2025-02-15 525/week @ 2025-02-22 614/week @ 2025-03-01 358/week @ 2025-03-08 649/week @ 2025-03-15 357/week @ 2025-03-22 388/week @ 2025-03-29 486/week @ 2025-04-05 525/week @ 2025-04-12 386/week @ 2025-04-19 308/week @ 2025-04-26

1,809 downloads per month
Used in journal-forwarder

WTFPL license

12KB
160 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–11MB
~129K SLoC