Exports: atomic file writes, export folder locks, re-export unreadable model.json (SIX-203) #259
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!259
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/259/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-25 11:55 UTC · original
holdmysocks:six-203-atomic-writes→master· +447 −215 · 46 files · 2 commits · merged 2026-11-25 12:33 UTCFixes SIX-203: a large
extract --forcerun over existing folders left some model.json files with a new JSON object followed by an older file's tail, and others zero-filled after runs were killed.What changes
sixng_core::atomicmodule.atomic::writereplacesfs::writeandatomic::AtomicFilereplacesBufWriter<File>for every export write in sixng-core and the CLI: model.json, materials.json, GLBs, buffers, textures and PNGs, index.jsonl, manifests, map and placement jsonl and bins, gz indexes, vehicle and outfit GLBs, and movies. Each file goes to a hidden temp file in its folder and is renamed over the target. A killed run keeps the old file. Two writers leave one complete copy..sixng.lockfile held on an open handle, so the OS frees it if the process dies. A second run waits up to two minutes, then reports the folder as busy. The holder clears temp files that killed runs left behind.--force, the skip-if-present check treats a model.json or dictionary.json that doesn't parse as missing. A plain re-run repairs the bad files.Tests
cargo check --workspace --all-targetsis clean, andcargo test -p sixng-core -p sixng-gui --releasepasses.Not covered
fs::write.