Home  |  Delphi .net Home  |  System.IO.Path  |  GetFullPath Method
GetFullPath  
Method  
Gets the full path for a relative Path string
Path Class
System.IO NameSpace
CF1.  Procedure GetFullPath ( PathString : String; ) ; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
If the specified PathString is relative (IsPathRooted = false), the GetFullPath method will return the current directory value suffixed by PathString, with a directory separator added inbetween.
 
Otherwise, PathString is returned unchanged.
Microsoft MSDN Links
System.IO
System.IO.Path
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

var
  PathString : String;

begin
  PathString := 'C:\Delphi\DelphiBasics.txt';
  Console.WriteLine('{0} full path :', PathString);
  Console.WriteLine(System.IO.Path.GetFullPath(PathString));

  Console.WriteLine;

  PathString := 'Unit1.pas';
  Console.WriteLine('{0} full path :', PathString);
  Console.WriteLine(System.IO.Path.GetFullPath(PathString));

  Console.Readline;
end.
Show full unit code
  C:\Delphi\DelphiBasics.txt full path :
  C:\Delphi\DelphiBasics.txt
  
  Uni1.pas full path :
  C:\Documents and Settings\Neil\My Documents\Borland Studio Projects\Unit1.pas
 
 
Delphi Programming © Neil Moffatt All rights reserved.  |  Contact the author