Mono Class Library: System.IO.Path Overview | MembersSystem.IO.Path.GetFullPath Method |
Returns information required to uniquely identify a file within a file system. [Edit]
|
A string containing the fully qualified (absolute) location of path . [Edit]
Type Reason System.Security.Permissions.FileIOPermission [Edit] Requires permission to access path information. See System.Security.Permissions.FileIOPermissionAccess.PathDiscovery .
Type Reason ArgumentException path is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.
-or-
The system could not retrieve the absolute path.
[Edit]System.Security.SecurityException The caller does not have the required permissions. [Edit] ArgumentNullException path is null . [Edit] System.IO.PathTooLongException The length of path or the absolute path information for path exceeds the system-defined maximum length. [Edit]
The absolute path includes all information required to locate a file or directory on a system. The file or directory specified by path is not required to exist; however if path does exist, the caller is required to have permission to obtain path information for path. Note that unlike most members of the System.IO.Path class, this method accesses the file system. [Edit]
The following example demonstrates the Path.GetFullPath(string) method on a Windows system. In this example, the absolute path for the current directory is c:\ecmatest\examples.
C# Example using System; using System.IO; class GetDirectoryTest { public static void Main() { string [] paths = { @"\ecmatest\examples\pathtests.txt", @"\ecmatest\examples\", "pathtests.xyzzy", @"\", }; foreach (string pathString in paths) Console.WriteLine("Path: {0} full path is {1}",pathString, Path.GetFullPath(pathString)); } }The output is
Path: \ecmatest\examples\pathtests.txt full path is C:\ecmatest\examples\pathtests.txt
Path: \ecmatest\examples\ full path is C:\ecmatest\examples\
Path: pathtests.xyzzy full path is C:\ecmatest\examples\pathtests.xyzzy
Path: \ full path is C:\
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0