Ok, as I understand it, 'pathrelativepath()' takes two directories as arguments, and returns the path of the second directory, as a path relative to the first.
In other words
Code:
pathrelativepath( "/home/bartonski/bin", "/home/bartonski/texts/novel");
should return "../texts/novel".
I don't know of any such function off hand, but rolling your own should be fairly trivial:
Step 1: Express both directories as absolute paths.
Step 2: remove the parts of the paths that are the same:
Code:
/home/bartonski/bin
/home/bartonski/texts/novel
Step 3: For each level in the first directory, prepend "../" to the second.
That, plus some error handling ought to get you where you need to go.
What language are you trying to write in?