9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Ugly hack
Date: Sun, 16 Feb 2003 10:40:31 -0500	[thread overview]
Message-ID: <a5a04673427d411f20d1266adf3704da@plan9.bell-labs.com> (raw)
In-Reply-To: <20030216170019.Q9084@cackle.proxima.alt.za>

> Well, the shell does not make use of any special kernel features
> to expand globbed arguments, it recursively descends the directory
> tree.  I'm addressing that aspect and I'm quite pleased with the
> results.

My impression was that you were trying to make

	echo */
and
	echo */.

match only the directories.  The fact that

	access("/adm/users/.", 0)

succeeds is a kernel bug and not something the shell
should be trying to hack around.  The dotdot paper
shows a good example (ksh) of what confusion
results when user-level programs try to fix kernel bugs
(in that case, the handling of dotdot).

Put another way, the definition of */. is (on Unix
or on Plan 9) all the valid paths you get by substituting
a name in the current directory for the star.
It so happens that this set is different on Plan 9,
and that is in fact a bug caused by early cleaning
of the names, and nothing more.  It's not the shell's
fault, and it's certainly not the shell's place to patch
it up.

In the process you appear to have improved rc's
performance somewhat, by using the extra information
you get from a Plan 9 readdir as opposed to a Unix readdir,
and that's nice, but not what I was referring to.

Russ



  parent reply	other threads:[~2003-02-16 15:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-15 15:46 Lucio De Re
2003-02-15 16:18 ` Sam
2003-02-15 16:21   ` Dan Cross
2003-02-15 16:29   ` Lucio De Re
2003-02-15 23:56 ` Geoff Collyer
2003-02-16  9:20   ` Lucio De Re
2003-02-16  9:25     ` Lucio De Re
2003-02-16 12:18       ` Lucio De Re
2003-02-16 12:45         ` Lucio De Re
2003-02-16 14:19 ` Russ Cox
2003-02-16 15:00   ` Lucio De Re
2003-02-16 15:31     ` David Butler
2003-02-16 15:40     ` Russ Cox [this message]
2003-02-17  5:27       ` Lucio De Re
2003-02-17  9:53 ` John Kodis

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=a5a04673427d411f20d1266adf3704da@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /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).