pub fn write_atomic(
path: &Path,
bytes: &[u8],
subject: &str,
) -> Result<(), WorktreeCopyError>Expand description
What:
Writes one private file atomically beside its final name; a failure names subject and leaves no temporary.
Why:
Journals and stage claims share one rule: a reader sees a complete file or none.
In TS you’d write (pseudocode):
await writeFileAtomically({ path, bytes, subject });