From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Thu, 12 Jun 2014 00:23:20 +0200." <5398D6D8.6010903@yahoo.fr> References: <20140611195245.B8F5AB827@mail.bitblocks.com> <20140611213207.814DDB827@mail.bitblocks.com> <5398D6D8.6010903@yahoo.fr> Date: Thu, 12 Jun 2014 10:44:40 -0700 From: Bakul Shah Message-Id: <20140612174440.F10EDB82A@mail.bitblocks.com> Subject: Re: [9fans] long paths in acme tags Topicbox-Message-UUID: fab8f78c-ead8-11e9-9d60-3106f5b1d025 On Thu, 12 Jun 2014 00:23:20 +0200 Nicolas Bercher wrote: > On 11/06/2014 23:32, Bakul Shah wrote: > > On Wed, 11 Jun 2014 22:27:34 BST Robert Raschke 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 foo cd foo The tag shows a rooted 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.