Skip to content

Commit 8a189e0

Browse files
authored
Fix bad markup. In Markdown, line break doesn't mean anything. (#55207)
1 parent 9c15196 commit 8a189e0

1 file changed

Lines changed: 21 additions & 20 deletions

File tree

‎docs/standard/io/file-path-formats.md‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ helpviewer_keywords:
1111
- "path formats, Windows"
1212
ai-usage: ai-assisted
1313
---
14+
1415
# File path formats on Windows systems
1516

1617
Members of many of the types in the <xref:System.IO> namespace include a `path` parameter that lets you specify an absolute or relative path to a file system resource. This path is then passed to [Windows file system APIs](/windows/desktop/fileio/file-systems). This topic discusses the formats for file paths that you can use on Windows systems.
@@ -25,8 +26,8 @@ A standard DOS path can consist of three components:
2526

2627
If all three components are present, the path is absolute. If no volume or drive letter is specified and the directory name begins with the [directory separator character](<xref:System.IO.Path.DirectorySeparatorChar>), the path is relative from the root of the current drive. Otherwise, the path is relative to the current directory. The following table shows some possible directory and file paths.
2728

28-
|Path |Description |
29-
| -- | -- |
29+
| Path | Description |
30+
| --- | --- |
3031
| `C:\Documents\Newsletters\Summer2018.pdf` | An absolute file path from the root of drive `C:`. |
3132
| `\Program Files\Custom Utilities\StringFinder.exe` | A relative path from the root of the current drive. |
3233
| `2018\January.xlsx` | A relative path to a file in a subdirectory of the current directory. |
@@ -55,24 +56,24 @@ Universal naming convention (UNC) paths, which are used to access network resour
5556

5657
The following are some examples of UNC paths:
5758

58-
|Path |Description |
59-
| -- | -- |
59+
| Path | Description |
60+
| --- | --- |
6061
| `\\system07\C$\` | The root directory of the `C:` drive on `system07`. |
61-
| `\\Server2\Share\Test\Foo.txt` | The `Foo.txt` file in the Test directory of the `\\Server2\Share` volume.|
62+
| `\\Server2\Share\Test\Foo.txt` | The `Foo.txt` file in the Test directory of the `\\Server2\Share` volume. |
6263

6364
UNC paths must always be fully qualified. They can include relative directory segments (`.` and `..`), but these must be part of a fully qualified path. You can use relative paths only by mapping a UNC path to a drive letter.
6465

6566
## DOS device paths
6667

6768
The Windows operating system has a unified object model that points to all resources, including files. These object paths are accessible from the console window and are exposed to the Win32 layer through a special folder of symbolic links that legacy DOS and UNC paths are mapped to. This special folder is accessed via the DOS device path syntax, which is one of:
6869

69-
`\\.\C:\Test\Foo.txt`
70-
`\\?\C:\Test\Foo.txt`
70+
- `\\.\C:\Test\Foo.txt`
71+
- `\\?\C:\Test\Foo.txt`
7172

7273
In addition to identifying a drive by its drive letter, you can identify a volume by using its volume GUID. This takes the form:
7374

74-
`\\.\Volume{b75e2c83-0000-0000-0000-602f00000000}\Test\Foo.txt`
75-
`\\?\Volume{b75e2c83-0000-0000-0000-602f00000000}\Test\Foo.txt`
75+
- `\\.\Volume{b75e2c83-0000-0000-0000-602f00000000}\Test\Foo.txt`
76+
- `\\?\Volume{b75e2c83-0000-0000-0000-602f00000000}\Test\Foo.txt`
7677

7778
> [!NOTE]
7879
> DOS device path syntax is supported on .NET implementations running on Windows starting with .NET Core 1.1 and .NET Framework 4.6.2.
@@ -81,19 +82,19 @@ The DOS device path consists of the following components:
8182

8283
- The device path specifier (`\\.\` or `\\?\`), which identifies the path as a DOS device path.
8384

84-
> [!NOTE]
85-
> The `\\?\` is supported in all versions of .NET Core and .NET 5+ and in .NET Framework starting with version 4.6.2.
85+
> [!NOTE]
86+
> The `\\?\` is supported in all versions of .NET Core and .NET 5+ and in .NET Framework starting with version 4.6.2.
8687
8788
- A symbolic link to the "real" device object (C: in the case of a drive name, or Volume{b75e2c83-0000-0000-0000-602f00000000} in the case of a volume GUID).
8889

89-
The first segment of the DOS device path after the device path specifier identifies the volume or drive. (For example, `\\?\C:\` and `\\.\BootPartition\`.)
90+
The first segment of the DOS device path after the device path specifier identifies the volume or drive. (For example, `\\?\C:\` and `\\.\BootPartition\`.)
9091

91-
There is a specific link for UNCs that is called, not surprisingly, `UNC`. For example:
92+
There is a specific link for UNCs that is called, not surprisingly, `UNC`. For example:
9293

93-
`\\.\UNC\Server\Share\Test\Foo.txt`
94-
`\\?\UNC\Server\Share\Test\Foo.txt`
94+
- `\\.\UNC\Server\Share\Test\Foo.txt`
95+
- `\\?\UNC\Server\Share\Test\Foo.txt`
9596

96-
For device UNCs, the server/share portion forms the volume. For example, in `\\?\server1\utilities\\filecomparer\`, the server/share portion is `server1\utilities`. This is significant when calling a method such as <xref:System.IO.Path.GetFullPath(System.String,System.String)?displayProperty=nameWithType> with relative directory segments; it is never possible to navigate past the volume.
97+
For device UNCs, the server/share portion forms the volume. For example, in `\\?\server1\utilities\\filecomparer\`, the server/share portion is `server1\utilities`. This is significant when calling a method such as <xref:System.IO.Path.GetFullPath(System.String,System.String)?displayProperty=nameWithType> with relative directory segments; it is never possible to navigate past the volume.
9798

9899
DOS device paths are fully qualified by definition and can't begin with a relative directory segment (`.` or `..`). Current directories never enter into their usage.
99100

@@ -164,7 +165,7 @@ As the path is processed, any components or segments that are composed of a sing
164165

165166
- For a double period, the current segment and the parent segment are removed, since the double period refers to the parent directory.
166167

167-
Parent directories are only removed if they aren't past the root of the path. The root of the path depends on the type of path. It is the drive (`C:\`) for DOS paths, the server/share for UNCs (`\\Server\Share`), and the device path prefix for device paths (`\\?\` or `\\.\`).
168+
Parent directories are only removed if they aren't past the root of the path. The root of the path depends on the type of path. It is the drive (`C:\`) for DOS paths, the server/share for UNCs (`\\Server\Share`), and the device path prefix for device paths (`\\?\` or `\\.\`).
168169

169170
### Trim characters
170171

@@ -174,10 +175,10 @@ Along with the runs of separators and relative segments removed earlier, some ad
174175

175176
- If the path doesn't end in a separator, all trailing periods and spaces (U+0020) are removed. If the last segment is simply a single or double period, it falls under the relative components rule above.
176177

177-
This rule means that you can create a directory name with a trailing space by adding a trailing separator after the space.
178+
This rule means that you can create a directory name with a trailing space by adding a trailing separator after the space.
178179

179-
> [!IMPORTANT]
180-
> You should **never** create a directory or filename with a trailing space. Trailing spaces can make it difficult or impossible to access a directory, and applications commonly fail when attempting to handle directories or files whose names include trailing spaces.
180+
> [!IMPORTANT]
181+
> You should **never** create a directory or filename with a trailing space. Trailing spaces can make it difficult or impossible to access a directory, and applications commonly fail when attempting to handle directories or files whose names include trailing spaces.
181182
182183
## Skip normalization
183184

0 commit comments

Comments
 (0)