Subject: Re: Little prob with rm
To: Greg A. Woods <woods@kuma.web.net>
From: Chris G. Demetriou <cgd@alpha.bostic.com>
List: current-users
Date: 10/31/1994 16:24:31
> Of course!  ;-)
> 
> But does namei() also strip/ignore the trailing slash accepted by open(2)?

for files, no.  you get an error if you try to open
/dira/dirb/dirc/file/ .

for directories, _NO_.  when you try to open directory:

/dira//dirb/////dirc

you are, in effect, trying to open:

/dira/./dirb/././././dirc

and when you try to open directory:

/dira/dirb/dirc/

you are, in effect, trying to open:

/dira/dirb/dirc/.


namei, in reality doesn't "collapse" anything.  if it sees a trailing
/, or a / followed by another /, it knows that the pathname is
referring to the current directory (.) for the missing component, and
behaves accordingly.



chris