Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions docs/standard/io/file-path-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "File path formats on Windows systems"
ms.date: "06/28/2018"
ms.technology: dotnet-standard
dev_langs:
- "csharp"
- "vb"
helpviewer_keywords:
- "I/O, long paths"
- "long paths"
Expand Down Expand Up @@ -207,29 +210,7 @@ Directory.Create("TeStDiReCtOrY")

creates a directory named TeStDiReCtOrY. If you rename a directory or file to change its case, the directory or file name reflects the case of the string used when you rename it. For example, the following code renames a file named test.txt to Test.txt:

```csharp
using System;
using System.IO;

class Example
{
public static void Main()
{
var fi = new FileInfo(@".\test.txt");
fi.MoveTo(@".\Test.txt");
}
}
```

```vb
Imports System.IO

Module Example
Public Sub Main()
Dim fi As New FileInfo(".\test.txt")
fi.MoveTo(".\Test.txt")
End Sub
End Module
```
[!code-csharp[case-and-renaming](~/samples/snippets/standard/io/file-names/cs/rename.cs)]
[!code-vb[case-and-renaming](~/samples/snippets/standard/io/file-names/vb/rename.vb)]

However, directory and file name comparisons are case-insensitive. If you search for a file named "test.txt", .NET file system APIs ignore case in the comparison. Test.txt, TEST.TXT, test.TXT, and any other combination of upper- and lowercase letters will match "test.txt".
5 changes: 4 additions & 1 deletion docs/standard/io/handling-io-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Handling I/O errors in .NET"
ms.date: "08/27/2018"
ms.technology: dotnet-standard
dev_langs:
- "csharp"
- "vb"
helpviewer_keywords:
- "I/O, exception handling"
- "I/O, errors"
Expand Down Expand Up @@ -81,4 +84,4 @@ You can handle these using a `When` clause in a catch statement, as the followin
- [Handling and throwing exceptions in .NET](../exceptions/index.md)
- [Exception handling (Task Parallel Library)](../parallel-programming/exception-handling-task-parallel-library.md)
- [Best practices for exceptions](../exceptions/best-practices-for-exceptions.md)
- [How to use specific exceptions in a catch block](../exceptions/how-to-use-specific-exceptions-in-a-catch-block.md)
- [How to use specific exceptions in a catch block](../exceptions/how-to-use-specific-exceptions-in-a-catch-block.md)