On 11/12/11, Peng Yu <[email protected]> wrote:
> On Sat, Nov 12, 2011 at 2:41 PM, Bjartur Thorlacius
> <[email protected]> wrote:
> I don't see how realpath can do what I want. relpath.py gives me the
> relative path of a from b. But realpath doesn't do so.
>
Sorry, my statement was completely false. Realpath -s is but a first
step to find relative pathnames between pathnames, whether absolute or
relative. Then the common prefix can be eliminated, if any. Finally
trailing pathname components of the base directory can be substituted
for .., and joined with the trailing pathname components of the
target.

> /tmp$ mkdir a b
> /tmp$ relpath.py a b
> ../a
>
IMO b should be the first, and preferably only, positional argument.
For the sake of iteration.

% relpath b a
../a

Reply via email to