-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Exception type changed for opening FileStream over invalid file name #54337
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsAttempting to create FileStream over
|
when fixed, revert dotnet/sdk@1c1a072 |
cc: @adamsitnik |
What we had for invalid path for both
What we have now:
Since IMO getting @stephentoub @danmoseley does that sound good to you? |
We have some tests that check the exception type for invalid path: runtime/src/libraries/System.IO.FileSystem/tests/File/Create.cs Lines 250 to 259 in 9d771a2
Would it be more natural to throw Edit: |
@marklio any thoughts? @adamsitnik what are the cases that changed - any invalid oath e.g. invalid characters? |
Is this fallout from the switch to use NtCreateFile? I'm not seeing a strong rationale here for making a breaking change. FileNotFoundException seems better to me than IOException, and I would not be at all surprised if this actually breaks real code. |
Attempting to create FileStream over
\\.\COM56
threw FileNotFoundException but now throws IOException. We should either reverse this or document a breaking change.The text was updated successfully, but these errors were encountered: