Skip to content

AppendText() and CreateText() throw DirectoryNotFoundException #7063

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UpperAvenue
Copy link
Contributor

Both methods throw the exception if the directory of the file being written to doesn't exist.

Summary

Added DirectoryNotFoundException to list of exceptions thrown for CreateText and AppendText. Pulled description text from OpenWrite.

Fixes #Issue_Number (if available)

Both methods throw the exception if the directory of the file being written to doesn't exist.
@ghost
Copy link

ghost commented Aug 20, 2021

Tagging subscribers to this area: @carlossanlop
See info in area-owners.md if you want to be subscribed.

Issue Details

Both methods throw the exception if the directory of the file being written to doesn't exist.

Summary

Added DirectoryNotFoundException to list of exceptions thrown for CreateText and AppendText. Pulled description text from OpenWrite.

Fixes #Issue_Number (if available)

Author: UpperAvenue
Assignees: -
Labels:

area-System.IO

Milestone: -

@UpperAvenue UpperAvenue changed the title AppendText() and CreateText() throw a DirectoryNotFoundException AppendText() and CreateText() throw DirectoryNotFoundException Aug 20, 2021
@opbld30
Copy link

opbld30 commented Aug 20, 2021

Docs Build status updates of commit a338232:

✅ Validation status: passed

File Status Preview URL Details
xml/System.IO/FileInfo.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@jozkee jozkee closed this Mar 15, 2024
@jozkee jozkee reopened this Mar 15, 2024
@jozkee jozkee requested a review from a team as a code owner March 15, 2024 17:15
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my suggestion adds some clarity.

@@ -277,6 +277,7 @@ C:\Users\userName\AppData\Local\Temp\tmp70CB.tmp was successfully deleted.

]]></format>
</remarks>
<exception cref="T:System.IO.DirectoryNotFoundException">The path specified when creating an instance of the <see cref="T:System.IO.FileInfo" /> object is invalid, such as being on an unmapped drive.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="T:System.IO.DirectoryNotFoundException">The path specified when creating an instance of the <see cref="T:System.IO.FileInfo" /> object is invalid, such as being on an unmapped drive.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The path specified when the instance of the <see cref="T:System.IO.FileInfo" /> object was created is invalid, such as being on an unmapped drive.</exception>

@@ -612,6 +613,7 @@ C:\Users\userName\AppData\Local\Temp\tmp70CB.tmp was successfully deleted.
]]></format>
</remarks>
<exception cref="T:System.UnauthorizedAccessException">The file name is a directory.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The path specified when creating an instance of the <see cref="T:System.IO.FileInfo" /> object is invalid, such as being on an unmapped drive.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="T:System.IO.DirectoryNotFoundException">The path specified when creating an instance of the <see cref="T:System.IO.FileInfo" /> object is invalid, such as being on an unmapped drive.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The path specified when the instance of the <see cref="T:System.IO.FileInfo" /> object was created is invalid, such as being on an unmapped drive.</exception>

@dotnet-policy-service dotnet-policy-service bot added the needs-author-action An issue or pull request that requires more info or actions from the author. label Mar 15, 2024
Copy link

Learn Build status updates of commit a338232:

✅ Validation status: passed

File Status Preview URL Details
xml/System.IO/FileInfo.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.IO needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants