file_system: add GetDiskFreeSpaceA/W and GetDiskFreeSpaceExA/W for console roots (RT-FS-DISK-FREE-SPACE) #2227
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2227"
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?
Imported from ubiquitarianism/leonida. Originally posted by matinsanei on 2026-11-26T07:52:17Z.
Claimed in the coordination issue as: RT-FS-DISK-FREE-SPACE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7185888432)
What and why
Adds shims for
GetDiskFreeSpaceA,GetDiskFreeSpaceW,GetDiskFreeSpaceExA, andGetDiskFreeSpaceExWtoruntime/shims/file_system.cpp:GAME:\,G:\,T:\) to the mapped host directories (r.game,r.overlay,r.scratch) before calling the host API.GetDiskFreeSpace[Ex]W.kernel32.dll,kernelbase.dll, and API set forwards.tests/test_fs_disk_free_space.py.Tested
python -I tests/test_fs_disk_free_space.py: Passed (1/1).python -I tests/test_text_write_line_endings.py: Passed (3/3).python3 scripts/check_no_game_data.py: Clean (0 errors).GPUs tested: n/a (file system shim)
AI-assisted: yes (Antigravity)
Checklist
mainand merges cleanlydocs/design.md, with how it was confirmed. (n/a)Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-26T07:52:31Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T08:47:42Z.
Review: COMMENTED
The new source check and the native
file_systemCTest pass. I exercised the new exports through the real shim registry with synthetic package and overlay roots and found a Win32 behavior mismatch below. No game files. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T08:47:42Z.
Code review location:
runtime/shims/file_system.cpp; line 1603[P2] Validate the requested directory when the console root exists.
parse_console()produces the relative components, but this call always queries the root. On native Windows the host API returned FALSE /ERROR_PATH_NOT_FOUNDfor an absent child of an existing directory, while the registeredGetDiskFreeSpaceExWandGetDiskFreeSpaceExAboth returned TRUE for itsGAME:equivalent. The existing-directory control passed on both paths.T:showed the same missing-child behavior. Please resolve the requested directory through the normal console mapping once the root is mounted, so callers receive the actual directory error.Imported from ubiquitarianism/leonida. Originally posted by matinsanei on 2026-11-26T10:11:50Z.
Code review location:
runtime/shims/file_system.cpp; line 1603Good catch! Updated in commit
1fb1c5e: when console roots are mounted, the requested directory is now resolved throughview(r, parts)and checked forKind::Directory. If an absent child or non-directory is requested, it correctly fails withERROR_PATH_NOT_FOUNDto match native Win32GetDiskFreeSpaceExbehavior on bothGAME:andT:. When the directory exists,GetDiskFreeSpaceExWis queried on the resolved host path.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T10:32:30Z.
Code review location:
runtime/shims/file_system.cpp; line 1603Retested
1fb1c5e27on native Windows through the shim registry. For a missing child under mountedGAME:, bothGetDiskFreeSpaceExWandGetDiskFreeSpaceExAnow return FALSE andERROR_PATH_NOT_FOUND(3), matching Win32. A missing child underT:also returns FALSE and 3. The existing directory and theT:root controls pass. My review point is addressed. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T09:48:58Z.
Red/green: tests/test_fs_disk_free_space.py fails on main (1 failed) and passes with this PR (1 passed).
Runtime batch of 20 PRs tested by OreoFR (full build, ctest without the game, Python suite, translator): same results as main
09c153948, RTX 4070 Laptop / Windows 11.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:00:15Z.
Verified by OreoFR
09c153948+ PR head1fb1c5e27; integration package 1 of 6 (20 PRs, merged without conflict)AI-assisted (Claude Code, Claude Opus 5.5).