Add AtomicWriteFile to replace a file's contents in one step #18

Merged
sneak merged 1 commits from clawbot/util:proposal-atomic-write-file into master 2026-09-05 05:44:11 +02:00

1 Commits

Author SHA1 Message Date
9708301eba add AtomicWriteFile for replacing a file in one step
AtomicWriteFile writes to a temporary file in the same directory, flushes it,
sets the mode and renames it over the target, so a reader never sees a
half-written file and a failure leaves the old one untouched. Comes with a doc
comment and table-driven tests. (closes #17)

Model: opus-5
2026-09-05 03:30:52 +00:00