From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] Ugly hack From: "Russ Cox" In-Reply-To: <20030216170019.Q9084@cackle.proxima.alt.za> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Sun, 16 Feb 2003 10:40:31 -0500 Topicbox-Message-UUID: 62d20e5c-eacb-11e9-9e20-41e7f4b1d025 > 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