Next in Review Queue: The New std.path

Vladimir Panteleev vladimir at thecybershadow.net
Fri Jul 15 09:47:04 PDT 2011


On Fri, 15 Jul 2011 18:55:58 +0300, Lars T. Kyllingstad  
<public at kyllingen.nospamnet> wrote:

> 3. There are infinitely many possibilities for a relative path

The shortest version is most useful. The idea is to do this:
1) find a common root
    (if none exists, return input absolute path as is)
2) add as many ../ as necessary to reach common root from base path
3) append second part of input path

> I don't know how useful this function will be.  Please convince me
> otherwise.

Some software and tools will commonly create and output absolute paths.  
There are non-relocatable; for example, if you want to copy a build script  
generated by an IDE, you need to update all absolute paths, or convert  
them to relative ones. My argument is that I recall looking for this  
function in the old std.path several times, and was disappointed not to  
find it.

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list