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

[Windows] Match error behavior of POSIX #2511

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

gmittert
Copy link
Contributor

On POSIX Foundation, removing a file is considered writing to it and so
when the file to be removed isn't found, it throws fileNoSuchFile. Since
Windows instead checks for the file attributes first which is considered
a read, it throws there with fileReadNoSuchFile. In removeItem to match
that behavior, we catch the fileReadNoSuchFile and turn it into
fileNoSuchFile.

On POSIX Foundation, removing  a file is considered writing to it and so
when the file to be removed isn't found, it throws fileNoSuchFile. Since
Windows instead checks for the file attributes first which is considered
a read, it throws there with fileReadNoSuchFile. In removeItem to match
that behavior, we catch the fileReadNoSuchFile and turn it into
fileNoSuchFile.
@gmittert
Copy link
Contributor Author

@swift-ci please test

@gmittert
Copy link
Contributor Author

@swift-ci please test linux

@gmittert gmittert merged commit 6134036 into swiftlang:master Sep 17, 2019
@gmittert gmittert deleted the WindowsShouldBePOSIXCompatible branch September 17, 2019 23:39
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.

1 participant