Omega -1911 wrote:
>
> I recently decided to host a site on one of my machines (Win XP,
> Active State 5.8.8) for testing a couple of scripts since my host
> objects to installing a few modules. Anyway, can someone explain why
> the following code will create directories and the the code below it
> will not (keep getting permission denied errors). First thing that
> stands out is chmods, but I thought that both the shebang and
> permissions are not needed on Win XP.
>
> Any thoughts?
> Any help appreciated!
>
> WORKS
> ----------------
> if (-e "$new_dir"){ die("Directory $new_dir previously created.\n") }
>  mkdir ($new_dir,$chmod) || die("Error making Directory $new_dir $!\n");
>  exit();
>
> GIVES PERMISSION DENIED ERROR (on a Win XP but works on *nix)
> ---------------------------------------------------------
> mkdir("$new_dir") || die("Error: $!");

I'm struggling to believe that the code you show is the only difference. My
first guess is that the the two examples try to create directories in different
places, one of which is permitted and the other not. First of all take off those
double quotes which can cause problems (but not the ones you're seeing I don't
believe).

  die "Directory $new_dir previously created" if -e $new_dir;

and

  mkdir $new_dir or die $!;

But there's not much else to say without more details. Try just removing the
chmod parameter from the code that works, I bet it doesn't start failing!
What else can you tell us about this problem?

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to