bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: logical paths


From: Kartik K. Agaram
Subject: Re: logical paths
Date: Sat, 9 Sep 2006 15:20:46 -0500 (CDT)

Bob Proulx:
The $PWD process environment variable is a construct created by the command shell. The chdir(2) operating system call does not modify any process environment variable. Keeping those two in sync is not an operating system function and is never automatic. When mixing programs with different conventions one will always be surprisingly different than expected from the other one.

Eric Blake:
However, there is nothing preventing coreutils from adding additional command-line options that tell tools to interpret $PWD and behave on relative paths logically.

This was sort of what I was hoping for :) I realize converting the world will be slow and painful, and that all bets are off for tools that chdir() internally, but just giving coreutils such options would get this leaky abstraction most of the way there. I will submit patches in a bit.

Eric Blake:
On the other hand, it is quite easy to type `pwd`/../z, and get a valid physical path to hand to cp, regardless of whether $PWD is currently physical or logical..

Just the sort of workaround I was looking for, but it doesn't seem to quite work. However, this does work: Type `pwd`/../ and press <Tab>. At least in bash, `pwd` gets expanded on the commandline. Thanks.

Eric Blake:
Please use a subject line.  It makes it less likely that your message will
be discarded as junk.

Apologies. I've given up on subject lines in casual email, but of course they're useful in a mailing list.

Bob Proulx:
At this point try this and remember the inode numbers.
 ls -ldogi . x x/y

Thanks for the nice tour.

Kartik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]