On Thu, 12 Jun 2014 00:23:20 +0200 Nicolas Bercher <[email protected]> wrote: > On 11/06/2014 23:32, Bakul Shah wrote: > > On Wed, 11 Jun 2014 22:27:34 BST Robert Raschke <[email protected]> w > rote: > >> > >> Whenever they are available, I use symlinks for "shortening" paths for > >> Acme. This is so far the only good use I've found for them ;-) > > > > Symlinks don't help in the tag as pwd finds the real path. > > Which pwd are you talking about? > GNU's pwd does not resolve symlinks (pwd -P does), nor p9p's acme.
This could be your shell's builtin pwd command. Try /bin/pwd Try this on MacOS in an acme window. ln -s <some long path> foo cd foo The tag shows a rooted <some long path> not foo And at least on the version of linux I am running, I see the full path when I type /bin/pwd. The same on FreeBSD. The pity is the BSD folks could've done symlinks right if only they had changed kernel code to store the entire current working dir path in the kernel instead of just an inode ptr and added a getcwd() kernel call. It is pretty clear that once you have more than one path to a directory, grubbing around in successive parent directories to compute a path was not the right thing to do. All you need to do is to understand that . and .. simply define the following rules: prefix/dir/.. == prefix prefix/. == prefix where dir is neither . nor .. This would've taken away the surprising behavior of cding to path containing .. and symlinks. Not only that you don't need . and .. entries if you store the rooted path to cwd in the kernel. I was very glad to see that the Plan9 folks got rid of the . and .. entries. The weird shell behavior is also an artifact of the original hack. You got different results in csh and sh.
