Subject: Re: bin/31869: find and trailing slash
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 10/28/2005 17:50:02
The following reply was made to PR bin/31869; it has been noted by GNATS.
From: "Greg A. Woods" <woods@weird.com>
To: zafer@gmx.org
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/31869: find and trailing slash
Date: Fri, 28 Oct 2005 13:49:11 -0400
At Wed, 19 Oct 2005 11:46:00 +0000 (UTC),
zafer@gmx.org wrote:
>
> when I run
>
> $ find /usr/pkgsrc/ -name Makefile -mindepth 3 -maxdepth 3
>
> the output is:
>
> /usr/pkgsrc//archivers/9e/Makefile
> /usr/pkgsrc//archivers/arc/Makefile
> /usr/pkgsrc//archivers/advancecomp/Makefile
> /usr/pkgsrc//archivers/afio/Makefile
> ...
>
> There is one slash too much after "/usr/pkgsrc/"
No, not really -- multiple slashes are always treated as one by the
kernel so there's nothing wrong per se with having as many as you wish.
This has been true for all Unix systems since at least the 6th Edition.
> The Problem is non-critical and appears also in 2.x
It's not only non-critical, it's not even really a cosmetic issue, at
least so long as the user is cognizant of some simple and basic, but
very fundamental, concepts of how a Unix filesystem interface works.
Keep in mind also that a trailing slash or multiple trailing slashes
should always be considered to be NUL bytes, i.e. string terminators.
Or at least that's the way a _real_ UNIX(tm) filesystem always works and
always has worked. :-)
--
Greg A. Woods
H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Secrets of the Weird <woods@weird.com>