file_system: a GAME: name inside a missing folder fails with ERROR_PATH_NOT_FOUND, as on the host #271

Closed
github-bot wants to merge 1 commit from gh-pr/271/head into gh-pr/271/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:56 UTC · original
ubiquitarianism:old-pr/10004 → main · +56 −10 · 3 files · 1 commits · closed without merging

Carried over from old PR 10004 by AirKyzzZ in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10004, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
AirKyzzZ: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: new RT item (claim). Resubmits #7316, closed in the reset.

What and why

DeleteFile, RemoveDirectory, SetFileAttributes and the source of MoveFile(Ex) answered every GAME: name the title can't see with ERROR_FILE_NOT_FOUND. The host tells two cases apart: a name inside a folder that is missing, or below a file, is ERROR_PATH_NOT_FOUND, and only a missing name in a folder that exists is ERROR_FILE_NOT_FOUND. Measured on Windows 10 22H2 with the real calls on a scratch folder: 3 for all four calls on missing\x.txt, missing\deeper\x.txt and file.txt\x.txt, 2 for nope.txt. CreateDirectory, CopyFile, the write opens and FindFirstFile already make that split here.

The four calls now pick the error with the same is_folder(parent_of(parts)) test the others use, so a folder the title removed counts as missing too. One existing check expected ERROR_FILE_NOT_FOUND for DeleteFileW(GAME:\nope\missing.txt), where nope doesn't exist; it now expects ERROR_PATH_NOT_FOUND, the host's answer. One sentence in docs/runtime_imports.md.

Same change as #7316, on top of current main (d083a2c); the only conflict was main renaming join to disk_path on the MoveFile line.

Tested

Windows 10 22H2 (19045), RTX 2060 / NVIDIA 566.14, Ryzen 5 2600X, clang-cl 23.1.6 + lld-link, MSVC 14.44 STL, Windows SDK 10.0.26100, Ninja:

  • This head's tree: ctest file_system passes.
  • On #7316 (b9c590fd2): file_system_test 457 checks OK; with main's file_system.cpp it failed 9 (the 8 new path-not-found checks and the updated one).
  • Outside checks on #7316: review, Windows (MSVC), RTX 5090, RTX 4070.

No game files. AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (no translator change)
**@⁠Andretuta** on GitHub · 2026-11-24 02:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/271) `ubiquitarianism:old-pr/10004` → `main` · +56 −10 · 3 files · 1 commits · closed without merging > Carried over from **old PR 10004** by `AirKyzzZ` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10004`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `AirKyzzZ`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: new RT item ([claim](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116988678)). Resubmits `#7316`, closed in the reset. ### What and why `DeleteFile`, `RemoveDirectory`, `SetFileAttributes` and the source of `MoveFile(Ex)` answered every `GAME:` name the title can't see with `ERROR_FILE_NOT_FOUND`. The host tells two cases apart: a name inside a folder that is missing, or below a file, is `ERROR_PATH_NOT_FOUND`, and only a missing name in a folder that exists is `ERROR_FILE_NOT_FOUND`. Measured on Windows 10 22H2 with the real calls on a scratch folder: 3 for all four calls on `missing\x.txt`, `missing\deeper\x.txt` and `file.txt\x.txt`, 2 for `nope.txt`. `CreateDirectory`, `CopyFile`, the write opens and `FindFirstFile` already make that split here. The four calls now pick the error with the same `is_folder(parent_of(parts))` test the others use, so a folder the title removed counts as missing too. One existing check expected `ERROR_FILE_NOT_FOUND` for `DeleteFileW(GAME:\nope\missing.txt)`, where `nope` doesn't exist; it now expects `ERROR_PATH_NOT_FOUND`, the host's answer. One sentence in `docs/runtime_imports.md`. Same change as `#7316`, on top of current `main` (`d083a2c`); the only conflict was `main` renaming `join` to `disk_path` on the `MoveFile` line. ### Tested Windows 10 22H2 (19045), RTX 2060 / NVIDIA 566.14, Ryzen 5 2600X, clang-cl 23.1.6 + lld-link, MSVC 14.44 STL, Windows SDK 10.0.26100, Ninja: - This head's tree: ctest `file_system` passes. - On `#7316` (`b9c590fd2`): `file_system_test` 457 checks OK; with `main`'s `file_system.cpp` it failed 9 (the 8 new path-not-found checks and the updated one). - Outside checks on `#7316`: [review](https://github.com/ProjectLeonida/Leonida/pull/7316#issuecomment-7107256039), [Windows (MSVC)](https://github.com/ProjectLeonida/Leonida/pull/7316#issuecomment-7107278183), [RTX 5090](https://github.com/ProjectLeonida/Leonida/pull/7316#issuecomment-7107480391), [RTX 4070](https://github.com/ProjectLeonida/Leonida/pull/7316#issuecomment-7108931506). No game files. AI-assisted (Claude Code). ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (no translator change)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:51:26 +00:00
github-bot closed this pull request 2026-11-26 08:51:26 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 19:10 UTC · original

Closing: everything this pull request changes is already in main. Merging it into main (490f5b9ec) leaves every file as it is. The same change landed with #760.

Thanks for the work! If something here is still missing from main, open a new pull request with what's left.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 19:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/271#issuecomment-7171908857) Closing: everything this pull request changes is already in `main`. Merging it into `main` (`490f5b9ec`) leaves every file as it is. The same change landed with #760. Thanks for the work! If something here is still missing from `main`, open a new pull request with what's left. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.