in reply to Re: freaky mkdir problem
in thread freaky mkdir problem

the first. and the second. and File::Path's:
mkpath( '/blah/10' , 0 , 0775 ) or die "$!";
they all return the same error, which I mentioned in the original post. the issue isn't how I'm implementing the mkdir, it's the fact the mkdir is creating a file instead of a directory.
personally, I'm at a loss to see how any implementation of mkdir can explain what I'm seeing. which, of course, might explain why I'm here in the first place.

Replies are listed 'Best First'.
Re: Re: Re: freaky mkdir problem
by dws (Chancellor) on Apr 27, 2001 at 00:30 UTC
    Very odd. Perhaps the "try to find a short script that will demonstrate the problem" approach might help.

    If, with an empty directory, you try something like:

    use File::Path; foreach my $n ( 0 .. 12 ) { mkpath("/blah/$n", 1, 0755) or die "$n: $!"; }
    do you still get a bogus "/blah/10". And if so, does "strings /blah/10" provide any hints about what the file is?

      output of the script:
      mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/0 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/1 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/2 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/3 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/4 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/5 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/6 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/7 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/8 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/9 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/10 mkdir /app/docs/intranet/Jupiter Media Metrix/mmf/1999/10: File exists + at throw.pl line 8
      the spaces in the directory have no effect. I've tried with non-spaced dir paths... same thing.

      and the file 10 is created. strings was a great idea... here's it's output:
      legal.html images 1998 1999 2000 2001 index.html Media: No such file or directory
      those are all directories or files involved in the copying (from the non-test script!). no idea how that info is getting into the test script's output.

      I'm going to go lie down now for a bit... :)
        You might be able to narrow this further, but testing for the existence of the errant file prior to each step. Try the equivalent of:
        use File::Path; foreach my $n ( 0 .. 12 ) { print "/blah/10 exists prior to step $n\n" if -e "/blah/10"; mkpath("/blah/$n", 1, 0755) or die "$n: $!"; }
      edit: better outputs below. dummied up the dir names, but realized the output of strings indicated some dependancies.