Subject: Re: mkdir with trailing / (patch proposed)
To: None <>
From: Jed Davis <>
List: tech-kern
Date: 04/28/2002 21:32:26
Rick Kelly <> writes:

> Greg A. Woods said:
>>UTSL!  I.e. read Lions or any one of the freely available Unix releases
>>-- and be assured the code is nearly identical in function even in the
>>most modern commercial Unix.  There's nothing "ancient" about this
>>feature except its heritage, which speaks only to its importance and
>>longevity.  In Unix one or more slashes at any point in a directory
>>pathname, including at the end, are and have always been, treated as a
>>single separator.
> I'm scratching my head over this.
> On 1.5.3RC1 and a recent -current I can:
> mkdir -p //foo//bar//
> without a problem and create /foo/bar.
> Was the failure mode something different?

I can "mkdir foo/" fine, but if I access mkdir(2) more directly, by
e.g.  perl -e 'mkdir "foo/" or die $!' (I assume this would also work
directly from C), it dies on ENOENT ("No such file or directory").

I assume that's what they mean.


#!/usr/bin/perl -- ## "But life wasn't yes-no, on-off.  Life was shades of gray,
sub f{(($n,$d,@_)=@_)?(substr(## and rainbows not in the order of the spectrum."
" ExhortJavelinBus",$n&&$d/$n,1),$n?f($d##   -- L. E. Modesitt, Jr., _Adiamante_
%$n,$n,@_):&f):("\n")}print f 1461,10324,55001,444162,1208,1341,5660480,79715997