The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Email Subscription

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 716 other subscribers

Conversion between absolute and relative paths in Delphi – Stack Overflow

Posted by jpluimers on 2013/07/30

A while ago, I needed routines to work with absolute and relative paths on Windows.

These links were very useful:

  1. The Delphi TPath.IsDriveRooted function (I think it was introduced in Delphi 2010) serves as a IsPathAbsolute function
  2. Conversion between absolute and relative paths in Delphi – Stack Overflow showing how to use the Windows API functions PathRelativePathTo and PathCanonicalize functions declared in the ShLwApi unit to create AbsToRel and RelToAbs functions.

Thanks Andreas Rejbrand and David Heffernan for the last two!

–jeroen

via: Conversion between absolute and relative paths in Delphi – Stack Overflow.

4 Responses to “Conversion between absolute and relative paths in Delphi – Stack Overflow”

  1. Use System.IOUtils.GetFullPAth

    • jpluimers's avatar

      jpluimers said

      I’m not sure (as right now I do not have access to the sources right now), but I think System.IOUtils.GetFullPAth only works one way, or would only work without specifying a base directory and I needed both ways while specifying a base directory.

  2. Joseph's avatar

    Joseph said

    You shouldn’t need to be using Windows API functions; Delphi is supposed to be a cross-platform solution now.

Leave a Comment

 

Discover more from The Wiert Corner - irregular stream of stuff

Subscribe now to keep reading and get access to the full archive.

Continue reading