Front page | perl.perl5.porters |
Postings from January 2001
Re: [ID 20010111.021] (builtin)mkdir and File::Path::mkpath problem
Thread Previous
From:
Jarkko Hietaniemi
Date:
January 17, 2001 20:06
Subject:
Re: [ID 20010111.021] (builtin)mkdir and File::Path::mkpath problem
Message ID:
20010117220616.E17071@chaos.wustl.edu
On Wed, Jan 17, 2001 at 08:57:45PM +0100, abigail@foad.org wrote:
> On Wed, Jan 17, 2001 at 08:55:24AM -0600, Jarkko Hietaniemi wrote:
> > On Wed, Jan 17, 2001 at 06:52:40AM -0800, Russ Allbery wrote:
> > > Jarkko Hietaniemi <jhi@iki.fi> writes:
> > >
> > > > I guess we could snip away a trailing slash. How about filesystems
> > > > with-non-slash element separators, any experience/opinions, anyone?
> > >
> > > It may also be worthwhile to check POSIX and see what it says mkdir should
> > > do in this case. I know that POSIX (or maybe it was X/Open) actually has
> > > a lot of stuff in it about what a trailing slash on a file name means and
> > > it's supposed to change the behavior of various commands in sometimes
> > > interesting and unintuitive ways.
> >
> > Checking POSIX is a good thing, and it usually pays to stick with
> > standards, but that shouldn't be our only guideline. There wasn't
> > any standard for Larry to design Perl.
>
>
> After we've decided what we do, we should at least document this, and
> if it's different from POSIX, it wouldn't hurt to mention that in the
> documentation as well.
POSIX 1003.1 1996 Edition:
5.4.1 Make a Directory
...
5.4.1.2 Description
The mkdir() routine creates a new directory with name /path/.
That's all about the path argument. On errors, 5.4.1.4, there is
nothing that either explicitly or implicitly seems to handle the case
of an extra trailing slash. Well, maybe the [ENAMETOOLONG]: The length
of the path argument exceeds {PATH_MAX}, or a pathname component...
So nothing at mkdir() definition itself, but in 2.2 (Definitions) we have:
2.2.2.78 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. Multiple successive slashes are considered to be the same as
one slash. A pathname that begins with two successive slashes may be
interpreted in an implementation-defined manner, although more than
two leading slashes shall be treated as a single slash. The
interpretation of the pathname is described in 2.3.6.
So if we really want to be POSIX we need to slash all the trailing slashes.
>
>
> Abigail
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
Thread Previous