Skip to main content

Module commit

Module commit 

Source
Expand description

Atomic on-disk commit for a staged save token.

[save::resolve_commit] is filesystem-free; this module supplies the real source re-read and a crash-safe replace (write temp sibling, fsync, rename). Path authorization is the caller’s job.

Enums§

CommitError

Functions§

commit_pdf_save
Consumes token, re-checks the on-disk source for same-path saves, and atomically writes the verified candidate to target (or back to the source path when None).
write_atomic
Writes bytes to target atomically: a temp file in the same directory is fsynced and then renamed over the target, so readers observe either the old or the new file, never a mix.