-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Location
https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#method.create_new
Summary
With create_new
option, we can create files if not exists and fail to create if already exists or fail with other general errors such as permission errors.
I want to retry with another file name if the failure is because file is already exists but there are no documentation about error kind in create_new
.
I think the error kind for create_new
failure due to file already exists is AlreadyExists
.
I think it's better to document that in create_new
.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.