write_atomic

Crates.iowrite_atomic
lib.rswrite_atomic
version0.7.0
created_at2021-07-03 22:04:27.687868+00
updated_at2025-06-01 04:23:49.33577+00
descriptionWrite to files atomically.
homepage
repositoryhttps://github.com/Blobfolio/write_atomic
max_upload_size
id418345
size28,406
Josh (joshstoik1)

documentation

README

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.*"
Commit count: 122

cargo fmt