Expand description
Shared atomic-write primitives.
Several modules (config, app/sys/task manifests, ssh transfer, workspace env files, self-install) each hand-rolled their own “write to a temp file, then rename over the destination” sequence. This module is the single place that logic lives.
Functions§
- atomic_
write - Durably writes
contentstopath. - finalize_
temp - Renames
tempoverdest, for callers that already wrote/streamed their own temp file (e.g. large-file copies) and only need the finalize step. - load_
toml_ or_ default - Loads and parses a TOML file at
path, or returnsT::default()if it doesn’t exist yet.whatis a human-readable label used in error messages (e.g."app manifest"). - save_
toml_ atomic - Serializes
valueas pretty TOML and atomically writes it topath.whatis a human-readable label used in error messages.