in reply to freaky mkdir problem

It really, really helps to post a code fragment that demonstrates the problem. The challenge with trying to describe what you're doing is that if you have blind spots, they carry over into your description. With code, we have something objective to analyze.

Without code to look at, I can't tell from your description whether you're trying   mkdir("/blah/10", 0nnn) or die "/blah/10: $!"; or

chdir("/blah") or die "/blah: $!"; mkdir("10", 0nnn) or die "10: $!";
One of these is fundamentally wrong. The other should work, or should tell you why it isn't working.

Replies are listed 'Best First'.
Re: Re: freaky mkdir problem
by markguy (Scribe) on Apr 27, 2001 at 00:11 UTC
    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.
      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... :)
        edit: better outputs below. dummied up the dir names, but realized the output of strings indicated some dependancies.