1 <Type Name="UnixPath" FullName="Mono.Unix.UnixPath">
2 <TypeSignature Language="C#" Value="public sealed class UnixPath" />
4 <AssemblyName>Mono.Posix</AssemblyName>
5 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
6 <AssemblyVersion>2.0.0.0</AssemblyVersion>
8 <ThreadingSafetyStatement>This type is safe for multithreaded operations.</ThreadingSafetyStatement>
10 <BaseTypeName>System.Object</BaseTypeName>
15 Performs operations on <see cref="T:System.String" /> instances that
16 contain file or directory path information.
20 A path is a string that provides the location of a file or directory.
21 A path does not necessarily point to a location on disk; for example,
22 a path may map to a location in memory or on a device. Paths are
23 composed of the components described below. Component names are shown
24 in <paramref name="italics " /> and the following table describes the
25 symbols used in component definitions:
30 <description>Description</description>
33 <term> < ></term>
34 <description>Indicates a path component.</description>
39 Indicates a grouping; either all components in a grouping are
40 present, or none are permitted to be present.
46 Indicates that the component or grouping that immediately precedes
47 this symbol can appear zero, one, or multiple times.
53 Indicates that the component or grouping that immediately precedes
54 this symbol can appear zero, or one times.
59 <description>Indicates string concatenation.</description>
62 <para>The components that define a path are as follows:</para>
64 <paramref name="Directory Name" />: A string that specifies one or
65 more directory levels in a file system. If a directory name contains
66 multiple levels, a <paramref name="directory separator character" />
67 separates the levels; however, a directory name does not begin or
68 end with a directory separator character. In the example path
69 <c>/foo/bar/bat.txt</c>, the directory name is "<c>foo/bar</c>".
70 <see cref="M:Mono.Unix.UnixPath.GetDirectoryName(System.String)" />
71 returns the directory name component of a path. Note that this method
72 does include a beginning separator character if one is included
73 in the specified path.
76 <paramref name="Directory Separator Character" />: An
77 implementation-defined constant string containing a single printable
78 non-alphanumeric character used to separate levels in a file system.
79 In the example path <c>/foo/bar/bat.txt</c>, the directory separator
80 character is "<c>/</c>".
81 The <see cref="F:Mono.Unix.UnixPath.DirectorySeparatorChar" /> and
82 <see cref="F:Mono.Unix.UnixPath.AltDirectorySeparatorChar" /> store
83 implementation-defined directory separator characters.
86 <paramref name="Extension" />: A string that consists of the
87 characters at the end of a file name, from and including the last
88 <paramref name="extension separator character" />. The minimum and
89 maximum lengths of extension components are platform-specific. In the
90 example path "<c>/foo/bar/bat.txt</c>", the
91 <paramref name="extension" /> is "<c>.txt</c>". The
92 <see cref="M:System.IO.Path.GetExtension(System.String)" /> method
93 returns the extension component of a path.
96 <paramref name="Extension Separator Character" />: An
97 implementation-defined constant string composed of a single character
98 that appears after the last character in the
99 <paramref name="file base" /> component indicating the beginning of
100 the <paramref name="extension" /> component. If the extension separator
101 character "<paramref name="." />" is the first character in a
102 <paramref name="file name" />, it is not interpreted as a extension
103 separator character. If more than one extension separator
104 character appears in a file name, only the last occurrence is the
105 extension separator character; all other occurrences are part of the
106 file base component. In the example path "<c>/foo/bar/bat.txt</c>",
107 the extension separator character is "<c>.</c>".
110 <paramref name="File Base" />: A string containing the
111 <paramref name="file name" /> with the <paramref name="extension" />
112 component removed. In the example path "<c>/foo/bar/bat.txt</c>",
113 the file base is "<c>bat</c>". The
114 <see cref="M:System.IO.Path.GetFileNameWithoutExtension(System.String)" />
115 method returns the file base component of a path.
118 <paramref name="File Name" />: A string containing all information
119 required to uniquely identify a file within a directory. This
120 component is defined as follows:
123 <c><file base>{+<extension>}?</c>
126 The file name component is commonly referred to as a relative
127 file name. In the example path "<c>/foo/bar/bat.txt</c>", the
128 file name is "<c>bat.txt</c>". The
129 <see cref="M:Mono.Unix.UnixPath.GetFileName(System.String)" />
130 method returns the file name component of a path.
133 <paramref name="Full Directory Name" />: A string containing all
134 information required to uniquely identify a directory within a file
135 system. This component is defined as follows:
138 <c><path root>+<directory name></c>
141 The full directory name component is commonly referred to as the
142 absolute directory name. In the example path "<c>/foo/bar/bat.txt</c>",
143 the full directory name is "<c>/foo/bar</c>".
146 <paramref name="Full Path" />: A string containing all information
147 required to uniquely identify a file within a file system. This
148 component is defined as follows:
151 <c><full directory name>+<directory separator
152 character>+<file name></c>
155 The full path component is commonly referred to as the absolute
156 file name. In the example path "<c>/foo/bar/bat.txt</c>", the full
157 path is "<c>/foo/bar/bat.txt</c>".
158 The <see cref="M:Mono.Unix.UnixPath.GetFullPath(System.String)" />
159 method returns the full path component.
162 <paramref name="Path Root" />: A string containing all information
163 required to uniquely identify the highest level in a file system.
164 The component is defined as follows:
167 <c>{<volume identifier>+<volume separator
168 character>}?+<directory separator character></c>
171 In the example path <c>/foo/bar/bat.txt</c> , the path root is
173 The <see cref="M:Mono.Unix.UnixPath.GetPathRoot(System.String)" />
174 method returns the <paramref name="path root" /> component.
177 The exact format of a path is determined by the current platform.
178 On some systems, paths containing file names can contain extensions.
179 The format of an extension is platform dependent; for example, some
180 systems limit extensions to three characters, while others do not.
181 The current platform and possibly the current file system determine
182 the set of characters used to separate the elements of a path, and
183 the set of characters that cannot be used when specifying paths.
184 Because of these differences, the fields of the
185 <see cref="T:Mono.Unix.UnixPath" /> class as well as the exact behavior
186 of some members of the <see cref="T:Mono.Unix.UnixPath" /> class are
187 determined by the current platform and/or file system.
190 A path contains either absolute or relative location information.
191 Absolute paths fully specify a location: the file or directory can be
192 uniquely identified regardless of the current location. A full path or
193 full directory name component is present in an absolute path.
194 Relative paths specify a partial location: the current working
195 directory is used as the starting point when locating a file specified
196 with a relative path.
197 <block subset="none" type="note">
198 To determine the current working directory, call
199 <see cref="M:Mono.Unix.UnixDirectoryInfo.GetCurrentDirectory" />.
202 Most members of the <see langword="UnixPath" /> class do not interact
203 with the file system and do not verify the existence of the file or
204 directory specified by a path string.
205 <see cref="T:Mono.Unix.UnixPath" /> members that modify a path string,
207 <see cref="M:Mono.Unix.UnixPath.Combine(System.String,System.String)" />,
208 have no effect on files and directories in the file system.
209 <see cref="T:Mono.Unix.UnixPath" /> members do, however, validate the
210 contents of a specified path string, and throw
211 <see cref="T:System.ArgumentException" /> if the string contains
212 characters that are not valid in path strings, as defined by the
213 current platform and file system. Implementations are required to
214 preserve the case of file and directory path strings, and to be case
215 sensitive if and only if the current platform is case-sensitive.
220 <Member MemberName="AltDirectorySeparatorChar">
221 <MemberSignature Language="C#" Value="public static readonly char AltDirectorySeparatorChar;" />
222 <MemberType>Field</MemberType>
224 <ReturnType>System.Char</ReturnType>
228 Provides a character used to separate directory levels in a
229 hierarchical file system.
232 <para>This field is read-only.</para>
233 <para>This is the value <c>/</c>.</para>
237 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
238 <AssemblyVersion>2.0.0.0</AssemblyVersion>
241 <Member MemberName="Combine">
242 <MemberSignature Language="C#" Value="public static string Combine (string path1, string[] paths);" />
243 <MemberType>Method</MemberType>
245 <ReturnType>System.String</ReturnType>
248 <Parameter Name="path1" Type="System.String" />
249 <Parameter Name="paths" Type="System.String[]">
252 <AttributeName>System.ParamArray</AttributeName>
259 A <see cref="T:System.String" /> containing the
263 A <see cref="T:System.String" /> array containing paths to append to
264 <paramref name="path1" />.
266 <summary>Concatentates multiple path strings.</summary>
269 A <see cref="T:System.String" /> containing
270 <paramref name="path1" /> followed by each sequential element in
271 <paramref name="paths" />.
274 If any of the specified paths is a zero-length string, it is ig
277 <remarks>To be added.</remarks>
280 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
281 <AssemblyVersion>2.0.0.0</AssemblyVersion>
284 <Member MemberName="DirectorySeparatorChar">
285 <MemberSignature Language="C#" Value="public static readonly char DirectorySeparatorChar;" />
286 <MemberType>Field</MemberType>
288 <ReturnType>System.Char</ReturnType>
292 Provides a character used to separate directory levels in a
293 hierarchical file system.
296 <para>This field is read-only.</para>
297 <para>This is the value <c>/</c>.</para>
301 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
302 <AssemblyVersion>2.0.0.0</AssemblyVersion>
305 <Member MemberName="GetCanonicalPath">
306 <MemberSignature Language="C#" Value="public static string GetCanonicalPath (string path);" />
307 <MemberType>Method</MemberType>
309 <ReturnType>System.String</ReturnType>
312 <Parameter Name="path" Type="System.String" />
315 <param name="path">To be added.</param>
316 <summary>To be added.</summary>
317 <returns>To be added.</returns>
318 <remarks>To be added.</remarks>
321 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
322 <AssemblyVersion>2.0.0.0</AssemblyVersion>
325 <Member MemberName="GetCompleteRealPath">
326 <MemberSignature Language="C#" Value="public static string GetCompleteRealPath (string path);" />
327 <MemberType>Method</MemberType>
329 <ReturnType>System.String</ReturnType>
332 <Parameter Name="path" Type="System.String" />
335 <param name="path">To be added.</param>
336 <summary>To be added.</summary>
337 <returns>To be added.</returns>
338 <remarks>To be added.</remarks>
341 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
342 <AssemblyVersion>2.0.0.0</AssemblyVersion>
345 <Member MemberName="GetDirectoryName">
346 <MemberSignature Language="C#" Value="public static string GetDirectoryName (string path);" />
347 <MemberType>Method</MemberType>
349 <ReturnType>System.String</ReturnType>
352 <Parameter Name="path" Type="System.String" />
355 <param name="path">To be added.</param>
356 <summary>To be added.</summary>
357 <returns>To be added.</returns>
358 <remarks>To be added.</remarks>
361 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
362 <AssemblyVersion>2.0.0.0</AssemblyVersion>
365 <Member MemberName="GetFileName">
366 <MemberSignature Language="C#" Value="public static string GetFileName (string path);" />
367 <MemberType>Method</MemberType>
369 <ReturnType>System.String</ReturnType>
372 <Parameter Name="path" Type="System.String" />
375 <param name="path">To be added.</param>
376 <summary>To be added.</summary>
377 <returns>To be added.</returns>
378 <remarks>To be added.</remarks>
381 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
382 <AssemblyVersion>2.0.0.0</AssemblyVersion>
385 <Member MemberName="GetFullPath">
386 <MemberSignature Language="C#" Value="public static string GetFullPath (string path);" />
387 <MemberType>Method</MemberType>
389 <ReturnType>System.String</ReturnType>
392 <Parameter Name="path" Type="System.String" />
395 <param name="path">To be added.</param>
396 <summary>To be added.</summary>
397 <returns>To be added.</returns>
398 <remarks>To be added.</remarks>
401 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
402 <AssemblyVersion>2.0.0.0</AssemblyVersion>
405 <Member MemberName="GetInvalidPathChars">
406 <MemberSignature Language="C#" Value="public static char[] GetInvalidPathChars ();" />
407 <MemberType>Method</MemberType>
409 <ReturnType>System.Char[]</ReturnType>
413 <summary>To be added.</summary>
414 <returns>To be added.</returns>
415 <remarks>To be added.</remarks>
418 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
419 <AssemblyVersion>2.0.0.0</AssemblyVersion>
422 <Member MemberName="GetPathRoot">
423 <MemberSignature Language="C#" Value="public static string GetPathRoot (string path);" />
424 <MemberType>Method</MemberType>
426 <ReturnType>System.String</ReturnType>
429 <Parameter Name="path" Type="System.String" />
432 <param name="path">To be added.</param>
433 <summary>To be added.</summary>
434 <returns>To be added.</returns>
435 <remarks>To be added.</remarks>
438 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
439 <AssemblyVersion>2.0.0.0</AssemblyVersion>
442 <Member MemberName="GetRealPath">
443 <MemberSignature Language="C#" Value="public static string GetRealPath (string path);" />
444 <MemberType>Method</MemberType>
446 <ReturnType>System.String</ReturnType>
449 <Parameter Name="path" Type="System.String" />
452 <param name="path">To be added.</param>
453 <summary>To be added.</summary>
454 <returns>To be added.</returns>
455 <remarks>To be added.</remarks>
458 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
459 <AssemblyVersion>2.0.0.0</AssemblyVersion>
462 <Member MemberName="IsPathRooted">
463 <MemberSignature Language="C#" Value="public static bool IsPathRooted (string path);" />
464 <MemberType>Method</MemberType>
466 <ReturnType>System.Boolean</ReturnType>
469 <Parameter Name="path" Type="System.String" />
472 <param name="path">To be added.</param>
473 <summary>To be added.</summary>
474 <returns>To be added.</returns>
475 <remarks>To be added.</remarks>
478 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
479 <AssemblyVersion>2.0.0.0</AssemblyVersion>
482 <Member MemberName="PathSeparator">
483 <MemberSignature Language="C#" Value="public static readonly char PathSeparator;" />
484 <MemberType>Field</MemberType>
486 <ReturnType>System.Char</ReturnType>
490 Provides a character to separate path strings in environment
494 <para>This field is read-only.</para>
495 <para>This is the value <c>:</c>.</para>
499 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
500 <AssemblyVersion>2.0.0.0</AssemblyVersion>
503 <Member MemberName="ReadLink">
504 <MemberSignature Language="C#" Value="public static string ReadLink (string path);" />
505 <MemberType>Method</MemberType>
507 <ReturnType>System.String</ReturnType>
510 <Parameter Name="path" Type="System.String" />
513 <param name="path">To be added.</param>
514 <summary>To be added.</summary>
515 <returns>To be added.</returns>
516 <remarks>To be added.</remarks>
519 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
520 <AssemblyVersion>2.0.0.0</AssemblyVersion>
523 <Member MemberName="TryReadLink">
524 <MemberSignature Language="C#" Value="public static string TryReadLink (string path);" />
525 <MemberType>Method</MemberType>
527 <ReturnType>System.String</ReturnType>
530 <Parameter Name="path" Type="System.String" />
533 <param name="path">To be added.</param>
534 <summary>To be added.</summary>
535 <returns>To be added.</returns>
536 <remarks>To be added.</remarks>
539 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
540 <AssemblyVersion>2.0.0.0</AssemblyVersion>
543 <Member MemberName="VolumeSeparatorChar">
544 <MemberSignature Language="C#" Value="public static readonly char VolumeSeparatorChar;" />
545 <MemberType>Field</MemberType>
547 <ReturnType>System.Char</ReturnType>
551 Provides a character to separate volumes from volume-specific paths.
554 <para>This field is read-only.</para>
555 <para>This is the value <c>/</c>.</para>
557 This field is basically useless, since Unix uses a
558 singly-rooted file system, all volumes are sub-directories of the
564 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
565 <AssemblyVersion>2.0.0.0</AssemblyVersion>