Repository navigation
Conversation
…ROR_FILE_NOT_FOUND read_target handed a name the overlay lacks to the package path. For a folder only the overlay has (all of T:\, and any folder the title made under GAME:\) the package has no such folder, so GetFileAttributes and a read-open failed with ERROR_PATH_NOT_FOUND where Windows answers ERROR_FILE_NOT_FOUND for a missing name in an existing folder, and where a write-open of the same name already answered ERROR_FILE_NOT_FOUND. The overlay path is used when the folder is in the overlay and not in the package. file_system_test compares with the host and keeps the missing folder, package folder and package file cases as they were. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ILE_NOT_FOUND The control the read-open fix is compared with: it passes before and after the change in read_target. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claim: #8047 (comment)
@ItsNotRexed: an exe PR, as you asked.
What
A read of a missing name in a folder that only the overlay has now fails with
ERROR_FILE_NOT_FOUND(2) instead ofERROR_PATH_NOT_FOUND(3).read_target(runtime/shims/file_system.cpp) hands a name the overlay lacks to the package path and lets the host answer. For a folder only the overlay has, the package has no such folder, so the host reports the folder as missing. That covers:T:\(the scratch folder lives in the overlay as.gta6rt-temp), andGAME:\.read_targetnow uses the overlay path when the name's folder is a folder in the overlay and is not in the package. Everything else still goes to the package path. The change is insideread_targetonly, so it reaches its callers: a read-open (CreateFileA/W,CreateFile2),GetFileAttributes(Ex)A/W, theCopyFile*source and theCreateDirectoryExtemplate.Why
On Windows a missing name in an existing folder is
ERROR_FILE_NOT_FOUND;ERROR_PATH_NOT_FOUNDmeans the folder itself is missing. The test checks both on a host temp folder. The shim also disagreed with itself: a write-open of the same missing name onT:\already answered 2.A title that probes its scratch drive before first use ("is my cache file there yet?") and treats only error 2 as "not there yet" takes its error path on 3. Whether the retail executable makes that distinction is not measured here: I did not read the executable, and no report in #7154 names this call. The CRT and
std::filesystemfold 2 and 3 together, so only direct Win32 checks see the difference.Separate from #7316 (the opposite direction, 2 → 3, for delete / remove / set-attributes / move source; it does not touch
read_target), #7672 (theT:\root) and #3532 (creating opens).Tested
Windows 11 (10.0.26200), MSVC 19.42 (VS 2022 Build Tools), RelWithDebInfo, NTFS. No GPU involved, no game files.
main@dde82f27e'sfile_system.cpp):456 check(s), 3 failure(s), exit 1:FAIL a missing name on T:\ is ERROR_FILE_NOT_FOUND for GetFileAttributesW and a read-openFAIL and in a folder of T:\FAIL a missing name in a folder the title made is ERROR_FILE_NOT_FOUND456 check(s), 0 failure(s), exit 0.ERROR_PATH_NOT_FOUND, onT:\nodir\…andGAME:\nodir\…;ERROR_FILE_NOT_FOUND;OPEN_EXISTING) of the missing name onT:answersERROR_FILE_NOT_FOUND;file_system.cppstill pass:xgameruntime_test(143 checks),xgameruntime_gamesave_test(56),xgameruntime_store_test(24),xgameruntime_offline_test(44),xgameruntime_user_test(42).python -I scripts/check_no_game_data.pyon the two changed files: exit 0.Not tested: Linux/Wine, and no boot of the title.
AI-assisted (Claude Code).
🤖 Generated with Claude Code