Alejandro Santillan wrote:
> The directory
> is create while the scrip runs under linux, but under windows
> it is not able to do it. It seems a permission problem, but
> the directory has all the permissions enabled and none
> disabled. The mkdir part of the script doesn't work, as it
> seems it is note allowed to create directories, but the
> second part works perfect so the script is indeed allowed to
> create a new file into the same directory.
>
> #now trying to create the session 11232 that fails
> $sys = "mkdir C:\\Inetpub\\wwwroot\\presupuestador\\Sessions\\11232";
Try using the File::Path module:
use File::Path;
my $dir = "C:/Inetpub/wwwroot/presupuestador/Sessions/11232";
eval { mkpath($dir) };
if ($@) {
print "Couldn't create $dir: $@";
}
If this doesn't work then you probably have a permissions issue. $@
should tell you.
Also, as a rule of thumb it's a good idea to use the forward slash "/"
character for directory separator in your perl scripts on Windows and
Unix. Everything works correctly and you won't get those nasty gotchas
when you forget to escape your backslashes. [ I've tested the above with
/ and \\ and everything works fine for me]
Cheers
Alistair
**********************************************************************
Registered Office:
Marks and Spencer plc
Waterside House
35 North Wharf Road
London
W2 1NW
Registered No. 214436 in England and Wales.
Telephone (020) 7935 4422
Facsimile (020) 7487 2670
<<www.marksandspencer.com>>
Please note that electronic mail may be monitored.
This e-mail is confidential. If you received it by mistake, please let us know
and then delete it from your system; you should not copy, disclose, or
distribute its contents to anyone nor act in reliance on this e-mail, as this
is prohibited and may be unlawful.
2005
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs