AtomicFiles

How every file this mod writes is published: built under a staging name, then renamed into place. Its readers decide by existence — a cache hit, a config file — so a path must never hold a half-written file; and the cache files stay OPEN for the process (the masking loader's urls, the symbol jars the compiler indexes), so a rewrite must not truncate what a reader still holds.

Root package, so the masking loader delegates it to the game loader and the writers on both sides reach this one copy.

Types

Link copied to clipboard
fun interface Writer

Writes one file's bytes to the staging path it is handed.

Functions

Link copied to clipboard

Commit p's bytes. A handle of its own is enough — the flush is per-file, not per-descriptor — so this runs after whoever wrote p closed their own stream.

Link copied to clipboard

Build dest through a staging file, then rename it into place.