9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] long paths in acme tags
Date: Thu, 12 Jun 2014 10:44:40 -0700	[thread overview]
Message-ID: <20140612174440.F10EDB82A@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Thu, 12 Jun 2014 00:23:20 +0200." <5398D6D8.6010903@yahoo.fr>

On Thu, 12 Jun 2014 00:23:20 +0200 Nicolas Bercher <nbercher@yahoo.fr> wrote:
> On 11/06/2014 23:32, Bakul Shah wrote:
> > On Wed, 11 Jun 2014 22:27:34 BST Robert Raschke <rtrlists@googlemail.com> 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.




  reply	other threads:[~2014-06-12 17:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 19:52 Bakul Shah
2014-06-11 20:02 ` erik quanstrom
2014-06-11 20:33 ` Aram Hăvărneanu
2014-06-11 20:37   ` erik quanstrom
2014-06-11 21:23   ` Bakul Shah
2014-06-11 21:27 ` Robert Raschke
2014-06-11 21:32   ` Bakul Shah
2014-06-11 21:56     ` erik quanstrom
2014-06-11 22:23     ` Nicolas Bercher
2014-06-12 17:44       ` Bakul Shah [this message]
2014-06-11 20:11 sl
2014-06-11 20:21 ` erik quanstrom
2014-06-11 20:31 sl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140612174440.F10EDB82A@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).