mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #2375] file_system: a move onto an existing GAME: folder reports ERROR_ALREADY_EXISTS (FS-MOVE-ONTO-FOLDER) #2377
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2377
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2375
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/fs-move-onto-folder📝 Commits (1)
cea424ffile_system: a move onto an existing GAME: folder reports ERROR_ALREADY_EXISTS (FS-MOVE-ONTO-FOLDER)📊 Changes
2 files changed (+28 additions, -1 deletions)
View changed files
📝
runtime/shims/file_system.cpp(+3 -1)📝
runtime/test/file_system_test.cpp(+25 -0)📄 Description
Claimed in the coordination issue as: FS-MOVE-ONTO-FOLDER
What and why
MoveFileExWon console paths refused a move onto an existing folder withERROR_ACCESS_DENIED, whatever the flags. The host only does that withMOVEFILE_REPLACE_EXISTING. Without it, any existing destination, a folder included, is "already there". Measured on Windows 11 with a small probe on an NTFS temp folder:COPY_ALLOWEDREPLACE_EXISTING(with or withoutCOPY_ALLOWED)ERROR_ALREADY_EXISTSERROR_ACCESS_DENIEDA title that checks for
ERROR_ALREADY_EXISTSto clear the way first and move again gotERROR_ACCESS_DENIEDinstead.MoveFileW, which passes no replace flag, has the same problem.The shim now reports any existing destination as
ERROR_ALREADY_EXISTSwhenMOVEFILE_REPLACE_EXISTINGis not set, and a folder asERROR_ACCESS_DENIEDwhen it is. Nothing else changes. One case still differs from the host, as before this change: the host letsMOVEFILE_REPLACE_EXISTINGmove a folder over an existing file, and the shim keeps refusing that withERROR_ACCESS_DENIED.Tested
Windows 11, MSVC 14.44 (Build Tools), RelWithDebInfo:
file_system_testgets checks in its MoveFile block. A package file is moved onto a package folder (GAME:\data\sub) and onto an overlay folder (GAME:\cache\renamed) withMoveFileExW(0),MoveFileWandMoveFileExW(MOVEFILE_REPLACE_EXISTING), then an overlay folder onto a package folder. The checks confirm that the file and the folder stay where they were.main: 5 of the new checks fail (each one that expectsERROR_ALREADY_EXISTS).file_system.cppor its test (checked withscripts/pr_overlap.pyfrom #2349). The six it lists as conflicting already conflict withmain, and none of them touches these lines.scripts/check_no_game_data.pyon both files.Not tested under Wine.
GPUs tested: n/a (CPU tests)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.