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.
Location
https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#method.create_new
Summary
With
create_newoption, 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_newfailure due to file already exists isAlreadyExists.I think it's better to document that in
create_new.