20 releases

0.5.2 Nov 28, 2024
0.5.0 Oct 5, 2023
0.4.0 Jul 25, 2023
0.3.1 Mar 31, 2023
0.1.0 Jul 3, 2021

#254 in Filesystem

Download history 450/week @ 2024-10-22 445/week @ 2024-10-29 254/week @ 2024-11-05 316/week @ 2024-11-12 391/week @ 2024-11-19 545/week @ 2024-11-26 537/week @ 2024-12-03 311/week @ 2024-12-10 335/week @ 2024-12-17 93/week @ 2024-12-24 172/week @ 2024-12-31 391/week @ 2025-01-07 319/week @ 2025-01-14 312/week @ 2025-01-21 859/week @ 2025-01-28 461/week @ 2025-02-04

2,044 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.5.*"

Dependencies

~1.7–10MB
~119K SLoC