Game saves: names Windows does not keep as file names stay intact #55
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!55
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/55/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?
@gefydev on GitHub · 2026-11-22 22:50 UTC · original
gefydev:gamesave-windows-names→main· +64 −2 · 1 files · 1 commits · merged 2026-11-23 09:44 UTCgamesave.rsturns container and blob names into file names withenc, which only escapes characters outside[A-Za-z0-9._- ]. Some names that pass through unchanged are ones Windows treats specially:"."and"..":pr.root.join(enc(name))is the provider's folder or its parent.XGameSaveDeleteContainer(p, "..")runsremove_dir_allongamesave\, deleting every provider's saves;"."deletes the whole provider.aux,CON.dat,COM1, ...): the write opens the device andXGameSaveSubmitUpdatereturnsE_FAIL.save.is enumerated assave.encnow escapes one more character for these (..→%2E%2E,aux→%41ux,save.→save%2E).decalready reverses%XX, and every other name keeps the file name it had, so existing saves are still found.Validation
names_windows_would_change_round_trip: containersaux,..andslot., each with blobsaux,CON.dat,save.andsave, all enumerate back with their names and sizes; deleting..and.leaves the provider's folder. Onmainit fails at the first submit (E_FAILforaux). Separately, onmain,XGameSaveDeleteContainer(p, ".")removes the provider's folder.cargo test -p xcl --lib: 340 passed, 0 failed, on Windows GNU under Wine.@ivall on GitHub · 2026-11-23 09:45 UTC · original
Merged (
331b734). On top (ff5c940): a device name with spaces before its extension (nul .txt) is escaped too – Win32 drops trailing spaces of the base; added tonames_windows_would_change_round_trip.Tested on Windows 11 (RX 9070):
cargo test --workspacegreen (lib 351, e2e), and a 45 s Unicorn Overlord run on the release build (VFS hooks active, ~60 fps, clean exit). Thanks!