VFS: RemoveDirectoryW on a non-empty game folder succeeds and hides the folder in every later run #997
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#997
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?
@Conrage on GitHub · 2026-11-24 10:06 UTC · original
RemoveDirectoryWon a game path goes toVfs::remove_dir, which never checks that the merged directory is empty:github.com/ivall/xcl@9aec53d/crates/xcl/src/vfs.rs (L635-L662)On Windows,
RemoveDirectoryWon a non-empty directory fails withERROR_DIR_NOT_EMPTY(145). Under XCL it returns success and the whole subtree disappears from the title's view. Whiteouts are saved tooverlay\.xcl_whiteoutsand loaded on start, so the folder stays hidden in every later run until the overlay is cleared.The repo's own test already shows the behaviour (
directoriesinvfs.rs, line 852): the fixture'sdatafolder holdshello.txtandgone.txt, andremove_dir("data")returnsOk(()).Why it matters: "remove the folder if it's empty" is a common cleanup pattern: call
RemoveDirectoryWon each folder and ignore the failure. A title doing that over its install folder would lose game data folders permanently under XCL.Expected:
remove_dirreturnsERROR_DIR_NOT_EMPTYwhen the merged view of the folder (overlay entries plus game entries that aren't whited out) has any entry. It only whites out an empty folder.Suggested fix: in
remove_dir, list the merged directory (asFindFirstFilealready does for listings) and refuse when it isn't empty. Adjust thedirectoriestest to match Win32.Not tested: found by reading the code and the existing unit test; not run (no Windows machine).
AI use: found, checked and written up by Claude Code (Claude Opus 5.5) at my request.
@ivall on GitHub · 2026-11-24 11:04 UTC · original
Fixed by #1016 (
47efa2e):RemoveDirectoryWon a game folder fails withERROR_DIR_NOT_EMPTYwhile its merged view has visible entries, and the overlay is left as it was.