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

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?

Replies are listed 'Best First'.
output of test script
by markguy (Scribe) on Apr 27, 2001 at 01:41 UTC
    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: $!"; }
        tried that... nothing there before the mkdir call :(
output of test script
by markguy (Scribe) on Apr 27, 2001 at 01:09 UTC
    edit: better outputs below. dummied up the dir names, but realized the output of strings indicated some dependancies.