develooper Front page | perl.perl5.porters | Postings from January 2001

Re: [ID 20010111.021] (builtin)mkdir and File::Path::mkpath problem

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
January 16, 2001 19:21
Subject:
Re: [ID 20010111.021] (builtin)mkdir and File::Path::mkpath problem
Message ID:
20010116212127.D14448@chaos.wustl.edu
> > Well, there's no (documented) change to the builtin mkdir(), either.
> > Sounds more like an operating system difference to me: how does one's
> > mkdir(2) work with trailing slashes.
> 
> Here is a small test program and it's output
> --mkdirtest.c--
> #include <stdio.h>
> #include <sys/stat.h>
> 
> Int main (void) /* Don't be pedantic */ {
>   if (mkdir("foo", 0777) == -1) perror("mkdirtest: foo");
>   if (mkdir("bar/", 0777) == -1) perror("mkdirtest: bar/");
>   return 0;
> }
> --
> 
> --mkdirtest output--
> $ ./mkdirtest
> mkdirtest: bar/: No such file or directory
> --
> 
> The directory 'foo' is created successfully, so I guess it's the libc that's
> the problem.  I checked the CVS log, couldn't find any relevant changes on
> first look. It is sad that this behavior breaks some Perl modules so I hope
> there is a way to fix this.

I guess we could snip away a trailing slash.  How about filesystems
with-non-slash element separators, any experience/opinions, anyone?

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About