Skip to content

Map EEXIST to PathAlreadyExists error, closes #20226 #20231

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

Merged
merged 1 commit into from
Dec 30, 2014

Conversation

fhahn
Copy link
Contributor

@fhahn fhahn commented Dec 25, 2014

I've created a patch for #20226, which maps EEXIST to the PathAlreadyExists error on Unix. To test this, I use mkdir, which raises EEXIST if the directory already exists.

On Windows, I map ERROR_ALREADY_EXISTS to PathAlreadyExist, but I am note sure if mkdir on Windows raises ERROR_ALREADY_EXISTS and do not have a Windows installation handy for testing.

And I noticed another thing. No error seems to map to IoErrorKind::PathDoesntExist and I am wondering what the difference to FileNotFound is?

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

In general I think we're going to carefully scrutinize IoErrorKind during I/O reform, and we'll reevaluate errors like PathDoesntExist which are not used today, but thanks for letting us know!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 30, 2014
I've created a patch for rust-lang#20226, which maps `EEXIST` to the `PathAlreadyExists` error on Unix. To test this, I use `mkdir`, which raises `EEXIST` if the directory already exists.

On Windows, I map `ERROR_ALREADY_EXISTS` to `PathAlreadyExist`, but I am note sure if `mkdir` on Windows raises `ERROR_ALREADY_EXISTS` and do not have a Windows installation handy for testing.

And I noticed another thing. No error seems to map to `IoErrorKind::PathDoesntExist` and I am wondering what the difference to `FileNotFound` is?
@bors bors merged commit eb4b202 into rust-lang:master Dec 30, 2014
@fhahn fhahn deleted the issue-20226-eexist branch December 30, 2014 12:11
@Blei
Copy link
Contributor

Blei commented Dec 30, 2014

Thanks!

@fhahn
Copy link
Contributor Author

fhahn commented Dec 30, 2014

@Blei I was wondering what you used to discover this error? In the test case, I used mkdir, but I am curious if there are other functions that raise EEXIST.

@Blei
Copy link
Contributor

Blei commented Dec 30, 2014

mkdir was indeed how I discovered it. I guess you could grep manpages for
other callers :)

Thanks again!

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.

6 participants