Re: Relative paths [was: Path transformation]

2006-08-21 Thread mal content
On 21/08/06, Peter Jeremy <[EMAIL PROTECTED]> wrote: On Mon, 2006-Aug-21 16:05:33 +0100, mal content wrote: >I have another favour to ask: Is there a function that can >take two absolute paths and generate a relative path, from >source to destination? I don't think there's any such function. My

Re: Relative paths [was: Path transformation]

2006-08-21 Thread Peter Jeremy
On Mon, 2006-Aug-21 16:05:33 +0100, mal content wrote: >I have another favour to ask: Is there a function that can >take two absolute paths and generate a relative path, from >source to destination? I don't think there's any such function. My suggestion is to roll your own, based on realpath(3) b

Relative paths [was: Path transformation]

2006-08-21 Thread mal content
Thanks to all who helped point me towards realpath(). I have another favour to ask: Is there a function that can take two absolute paths and generate a relative path, from source to destination? /usr/bin/false /bin Becomes: ../../bin /bin /usr/bin/false Becomes: ../usr/bin/false thanks, M