Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posix.renameW: Handle DIRECTORY_NOT_EMPTY more generally #19804

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

squeek502
Copy link
Collaborator

@squeek502 squeek502 commented Apr 29, 2024

Before this commit, the DIRECTORY_NOT_EMPTY/FILE_IS_A_DIRECTORY/NOT_A_DIRECTORY statuses were assumed only to be possible when using FILE_RENAME_INFORMATION_EX and FILE_RENAME_POSIX_SEMANTICS, but that has empirically been shown to be false; a networked samba share can return the DIRECTORY_NOT_EMPTY status from FILE_RENAME_INFORMATION (which doesn't support FILE_RENAME_POSIX_SEMANTICS).

FILE_IS_A_DIRECTORY and NOT_A_DIRECTORY were not proven to be possible (from my testing, OBJECT_NAME_COLLISION is returned when trying to name a file onto a directory or vice versa), but they were also moved to the outer switch just in case.

Fixes #19785

Before this commit, the DIRECTORY_NOT_EMPTY/FILE_IS_A_DIRECTORY/NOT_A_DIRECTORY statuses were assumed only to be possible when using `FILE_RENAME_INFORMATION_EX` and `FILE_RENAME_POSIX_SEMANTICS`, but that has empirically been shown to be false; a networked samba share can return the DIRECTORY_NOT_EMPTY status from `FILE_RENAME_INFORMATION` (which doesn't support `FILE_RENAME_POSIX_SEMANTICS`).

`FILE_IS_A_DIRECTORY` and `NOT_A_DIRECTORY` were not proven to be possible, but they were also moved to the outer switch just in case.

Fixes ziglang#19785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get Error Unexpected when you try to run build after first time on windows network shared folder
1 participant