XGameSave: a container's last-modified time stops changing after its first save #1034

Open
opened 2026-11-24 10:48:00 +00:00 by Conrage · 0 comments
Conrage commented 2026-11-24 10:48:00 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by Conrage on 2026-11-24T10:48:00Z.


each_container reports lastModifiedTime as the container folder's own modified time:

github.com/ivall/xcl@6efdabc/crates/xcl/src/hle/xgameruntime/gamesave.rs (L340-L344)

A folder's modified time changes only when an entry directly inside it is created, renamed or removed. The container folder holds just b\ and display, and blob writes and deletes happen inside b\ (apply, L564-L590). So:

  • the first update creates b\ and the time changes;
  • every later update with a null display name (XGameSaveCreateUpdate(c, nullptr, …), which the module's own tests use) only changes b\, so the container's time stays at the first save;
  • an update with a display name rewrites display in the container folder, so the time does change then.

Titles show this time in their load/save menus and use it to pick the newest slot ("continue"). Under XCL, a slot saved again later can look older than one saved once.

Repro (folder behaviour, any OS): make c\b\, set both folders' times to the past, write c\b\tmp and rename it to c\b\blob: c\b\ gets the current time, c\ keeps the old one. NTFS updates a folder's last-write time the same way.

Expected: lastModifiedTime is the time of the container's last submitted update.

Suggested fix: take the newest modified time of b\, display and the blob files, or touch the container folder at the end of apply.

Not tested: found by reading the code; the folder behaviour was checked on Linux, not run on Windows or with a title.

AI use: found, checked and written up by Claude Code (Claude Opus 5.5) at my request.

<!-- greyfinch-sync:ivall/xcl:issue:6580071703 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1041). Originally posted by [Conrage](https://github.com/Conrage) on 2026-11-24T10:48:00Z. --- `each_container` reports `lastModifiedTime` as the container folder's own modified time: https://github.com/ivall/xcl/blob/6efdabc/crates/xcl/src/hle/xgameruntime/gamesave.rs#L340-L344 A folder's modified time changes only when an entry directly inside it is created, renamed or removed. The container folder holds just `b\` and `display`, and blob writes and deletes happen inside `b\` (`apply`, L564-L590). So: - the first update creates `b\` and the time changes; - every later update with a null display name (`XGameSaveCreateUpdate(c, nullptr, …)`, which the module's own tests use) only changes `b\`, so the container's time stays at the first save; - an update with a display name rewrites `display` in the container folder, so the time does change then. Titles show this time in their load/save menus and use it to pick the newest slot ("continue"). Under XCL, a slot saved again later can look older than one saved once. **Repro (folder behaviour, any OS):** make `c\b\`, set both folders' times to the past, write `c\b\tmp` and rename it to `c\b\blob`: `c\b\` gets the current time, `c\` keeps the old one. NTFS updates a folder's last-write time the same way. **Expected:** `lastModifiedTime` is the time of the container's last submitted update. **Suggested fix:** take the newest modified time of `b\`, `display` and the blob files, or touch the container folder at the end of `apply`. **Not tested:** found by reading the code; the folder behaviour was checked on Linux, not run on Windows or with a title. **AI use:** found, checked and written up by Claude Code (Claude Opus 5.5) at my request.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#1034
No description provided.