RE: Creating a new directory from a script under windows

2005-12-05 Thread McGlinchy, Alistair
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

<>

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
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Creating a new directory from a script under windows

2005-12-05 Thread Bullock, Howard A.








See

 

use File::Path;    mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);    rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);

 






___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Creating a new directory from a script under windows

2005-12-05 Thread Chris Wagner
At 09:33 AM 12/5/2005 -0300, Alejandro Santillan wrote:
>The directory is create while the scrip runs under linux, but under windows
>it is not able to do it.

What webserver are u using?  IIS has known finicky permission problems.


>#now trying to create the session 11232 that fails
>$sys = "mkdir C:\\Inetpub\\wwwroot\\presupuestador\\Sessions\\11232";

Try this.
mkdir "C:\\Inetpub\\wwwroot\\presupuestador\\Sessions\\11232";

The entire C:\\Inetpub\\wwwroot\\presupuestador\\Sessions parent dir must
exist beforehand.






--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Creating a new directory from a script under windows

2005-12-05 Thread mark pryor
Alejandro Santillan <[EMAIL PROTECTED]> wrote:  I am programing a cgi that performs a series of tasks while interacting withthe client and that should keep a session alive for a week.In order to do that I decided to create a session directory each time aclient sings up.The directory is create while the scrip runs under linux, but under windowsit is not able to do it. Alejandro,In my experience, mkdir must be called one folder at a time. I split the desired path, then travel up till I find a valid path, then go back down, calling mkdir as I go.I have some working sample code here  http://www.tlviewer.org/fixdir.txtgood luck,  Mark Pryor
		 Yahoo! Personals 
Single? There's someone we'd like you to meet. 
Lots of someones, actually. Try Yahoo! Personals___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Creating a new directory from a script under windows

2005-12-05 Thread Alejandro Santillan
I am programing a cgi that performs a series of tasks while interacting with
the client and that should keep a session alive for a week.
In order to do that I decided to create a session directory each time a
client sings up.
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";

#now creating a new file without problems
open(SES,">C:\\Inetpub\\wwwroot\\presupuestador\\Sessions\\sessions.txt") or
die;
print SES $line;
close(SES);

Anyone sees the problem here?

Thank you,

Alejandro


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs