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

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

    Join 1,860 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

  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

This site uses Akismet to reduce spam. Learn how your comment data is processed.