19 releases

0.5.1 Sep 5, 2024
0.5.0 Oct 5, 2023
0.4.1 Sep 11, 2023
0.4.0 Jul 25, 2023
0.1.0 Jul 3, 2021

#220 in Filesystem

Download history 345/week @ 2024-07-04 297/week @ 2024-07-11 272/week @ 2024-07-18 422/week @ 2024-07-25 300/week @ 2024-08-01 410/week @ 2024-08-08 299/week @ 2024-08-15 315/week @ 2024-08-22 276/week @ 2024-08-29 492/week @ 2024-09-05 354/week @ 2024-09-12 343/week @ 2024-09-19 375/week @ 2024-09-26 412/week @ 2024-10-03 440/week @ 2024-10-10 494/week @ 2024-10-17

1,792 downloads per month
Used in journal-forwarder

WTFPL license

13KB
158 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.*"

License

See also: CREDITS.md

Copyright © 2024 Blobfolio, LLC <hello@blobfolio.com>

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

Dependencies

~1.6–9.5MB
~110K SLoC