Subject: Re: Trailing '/' to mkdir(2) revisited
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 06/23/2003 14:09:31
[ On Monday, June 23, 2003 at 11:10:49 (+0100), Ben Harris wrote: ]
> Subject: Re: Trailing '/' to mkdir(2) revisited
>
> Footnote for the bored: The problem with POSIX-2001 is that the definition
> of pathname resolution (section 4.11) says that pathnames ending in '/' that
> contain non-'/' characters are resolved as if they had '.' appended.
Yes, IIRC, that's the bug in POSIX-2001. Previously, and in all
historical real-world implementations, multiple slashes are collapsed to
one slash and a trailing slash on a pathnames is _ALWAYS_ ignored. From
the kernel's point of view trailing slashes do not mark directories, or
anything else for that matter -- they are simply ignored.
(Yes, trailing slashes can indicate the required presense of a directory
of the given name from the user's point of view of an application's
command-line interface, such as with tools like 'cp', 'mv', 'rsync',
etc., but that doesn't mean that's the way the underlying system calls
should work.)
--
Greg A. Woods
+1 416 218-0098; <g.a.woods@ieee.org>; <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>