VFS: RemoveDirectoryW fails on a non-empty merged directory #1033
No reviewers
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!1033
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1033/head"
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?
@DavidM1911 on GitHub · 2026-11-24 10:37 UTC · original
DavidM1911:vfs-rmdir-nonempty→main· +40 −0 · 2 files · 1 commits · closed without mergingVfs::remove_dirwhiteouted the game folder without checking its merged contents, so a title's "remove if empty" cleanup permanently hid non-empty data folders in every later run (whiteouts persist inoverlay\.xcl_whiteouts). It now lists the merged directory — overlay entries plus original entries that aren't whited out — and returnsERROR_DIR_NOT_EMPTY(145) when it isn't empty, matching Windows.Fixes #997
What is in it
vfs.rs:remove_dirrefuses withERROR_DIR_NOT_EMPTYwhen the merged view of the directory has any entry; whiteouts only an empty one.directoriesnow removes each fixture child beforeremove_dir;recreating_removed_directory_does_not_resurrect_original_childrenemptiesdatafirst; newremove_dir_rejects_non_empty_merged_directorycovers original-only children, overlay children, and whited-out children.vfs_hooks.rs:find_first_on_whited_out_and_recreated_directorydeletes the fixture files before removingdata.Tested
cargo test --workspace -- --test-threads=4on Windows 11 x64, RTX 3060 Ti: 676 passed / 0 failed / 41 ignored.cargo test -p xcl --lib vfs: 19 passed;vfs_hooks::tests::find_first_on_whited_out_and_recreated_directorypasses.truncate_existing_validation_errorsfails intermittently on this machine on cleanmaintoo (pre-existing, unrelated —GetLastErrorreturns 127 where 5 is expected).Regression run
main
a6f5f7a(NVIDIA GeForce RTX 3060 Ti, , 60 s):this PR's head
e6aeedfe(same title/GPU/seconds):Not tested
RemoveDirectoryWon a game folder.AI use
@ivall on GitHub · 2026-11-24 11:04 UTC · original
Thanks. #997 is fixed by #1016 (merged as
47efa2e), which has more of the cases under test (the overlay kept on failure, subdirectories, the whiteouts after a reload). Note for next time: the description lists a testremove_dir_rejects_non_empty_merged_directorythat is not in the diff, and the counts should come from a run on the PR's own head. Thetruncate_existing_validation_errorsfailure you saw is fixed ind78597d: the firstunder_wine()sets the thread's last error, and the test read it after that call. Closing as a duplicate.Pull request closed