Subject: Re: mkdir with trailing / (patch proposed)
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@netbsd.org>
From: Olaf Seibert <rhialto@polderland.nl>
List: tech-userlevel
Date: 04/29/2002 15:49:56
On Sun 28 Apr 2002 at 19:17:35 -0400, Greg A. Woods wrote:
> I can quote draft 11.2 of IEEE POSIX-1003.2, which says much the same:
>
> 2.2.2.102 pathname: A string that is used to identify a file.
>
> A pathname consists of, at most, {PATH_MAX} bytes, including the
> terminating null character. It has an optional beginning slash, followed
> by zero or more filenames separated by slashes. IF THE PATHNAME REFERS
> TO A DIRECTORY, IT MAY ALSO HAVE ONE OR MORE TRAILING SLASHES.
(emphasis added by Rhialto)
[...]
> That goes for mkdir(2),
> opendir() or any other system call accepting a pathname and which allows
> directory names, as well as of course any standard user-level utility.
There is one very important difference between mkdir(2) and opendir():
the path name handed to mkdir(2) DOES NOT refer to a directory! This for
the very simple reason that it does not exist yet.
> Greg A. Woods
-Olaf.
--
___ Olaf 'Rhialto' Seibert - rhialto@polder -- Ah only did well at school
\X/ land.nl -- tae git intae an O level class tae git away fae Begbie.