Repository navigation
file_system: GetTempPath and GetTempFileName resolve GAME:, G: and T: to the overlay scratch folder - #8813
file_system: GetTempPath and GetTempFileName resolve GAME:, G: and T: to the overlay scratch folder#8813tedin7 wants to merge 4 commits into
Conversation
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Verified on Windows 11.
- Properly routes console temporary directory paths (\T:\..., \GAME:\...) to the writable overlay scratch folder (
oots().overlay / kScratchDir):- Implements \GetTempPathW, \GetTempPathA, \GetTempFileNameW, and \GetTempFileNameA.
- Preserves sub-path components and strips the drive token for \Drive::Scratch.
- Non-console paths pass through transparently to the Win32 host APIs.
- Proper error propagation and \ERROR_PATH_NOT_FOUND\ normalization when the scratch directory is missing.
- Contract unit tests in
untime/test/file_system_test.cpp\ cover console temp routing, overlay isolation, and error scenarios. - Clean-room check and \git diff --check\ pass.
LGTM!
|
Tested
|
|
Verified head
AI-assisted. |
|
I compared the return counts from
The exact-size and larger buffers contained the same complete path and terminator. The ASCII control and all wide-character return counts agreed. I repeated the same matrix on This measures a representable UTF-8 path on Windows 11 x64 build 26200.9974. CPU-only, synthetic directories. AI-assisted (Codex). |
What
Route GetTempPathA/W and GetTempFileNameA/W for console paths to the overlay scratch directory. Pass host paths through and let the host implement temporary-file naming semantics.
Why
On the tested Wine host, GAME:\ is expanded into a host path and G:\ and T:\ remain drive paths; GetTempFileNameW fails for each. Temporary files must stay in the overlay.
Tested
file_system_test, origin/main with the same test: 460 checks, 15 failures; nine are the new checks, six concern existing MAXIMUM_ALLOWED behavior.file_system_test, review regression before the fix: 466 checks, 11 failures; five new subdirectory checks fail and the six existing MAXIMUM_ALLOWED failures remain.file_system_test, with the fix: 467 checks, 6 failures; all seven review checks pass, including TEMP fallback and refused path. The same six MAXIMUM_ALLOWED failures remain; the complete test is not green.file_system_test, Unicode path review: 468 checks, 6 existing MAXIMUM_ALLOWED failures; the new regression fails before the fix and passes after it.file_system_test, GetTempPathA Unicode review: 469 checks, 6 existing MAXIMUM_ALLOWED failures; the new check fails before the fix and passes after it.ctest: 62 passed, 2 skipped, 0 failed (64 total).python -I scripts/check_no_game_data.py runtime/shims/file_system.cpp runtime/test/file_system_test.cpppassed.@ItsNotRexed: an exe PR, as you asked.
Claim: #8683 (comment)