[Israel.pm] How to open a file on a network drive, using CGI.
roi__ at hotmail.com
Tue May 4 01:57:21 PDT 2004
thanks you all for the answers.
please note, that using the CGI from my local computer ,openning a folder on
the network server
which holds the perl script is successful.
what not successful using CGI is opening a folder on any other server on
that brings 2 queshtions:
1. is it still an apache permitions problem ?
2. is there a way to reset a value of what ever varible (either an %ENV
related or what ever)
on the perl script itself (inside the network) to make it think it
running localy or what ever
other way, and make it open a directory of a server on that same network.
(like it does when running localy as a perl script) ?
p.s i wouldn't want to create my own Apache, or change config value on the
Apache conf files.
>From: Ecker Lary <el01693 at elop.co.il>
>To: "'roi__ at hotmail.com'" <roi__ at hotmail.com>
>Subject: RE: [Israel.pm] How to open a file on a network drive, using CGI.
>Date: Tue, 4 May 2004 10:45:47 +0200
>When you run the perl program, it uses the user permissions, policies etc.
>When you run it from the CGI, it uses the permissions of the owner of the
>apache service (is it named "daemon" on unix?).
>I have apache on windows. I can "run the service as..."
>From: roi sh [mailto:roi__ at hotmail.com]
>Sent: Tuesday, May 04, 2004 9:17 AM
>To: perl at perl.org.il
>Subject: Re: [Israel.pm] How to open a file on a network drive, using CGI.
>Actualy it's a directory i'm trying to read.
>the error as written in the Apache errors log:
>[Tue May 04 02:13:59 2004] [error] [client [local IP]] can't open dir
>\\[server name]\c$\[folder]\[folder]\[folder]\Log: No such file or
>at c:\APACHE~1\apache\cgi-bin\OFFLIN~1.PL line 112.
>lines 111, 112 are:
>$directory = "\\\\[server name]\\c\$\\[folder]\\[folder]\\[folder]\\Log";
>opendir(DIRHANDLE, $directory) or die "can't open dir: $directory: $!";
>i also tried using the server IP instaed of its DNS name and it did not
>please note that running the perl script itself (not the CGI), from inside
>the network, the direcctory is opened:
>line 113 is: print (Dir $directory opened!") .
>its result: Dir \\[server name]\c$\[folder]\[folder]\[folder]\Log opened!.
> >From: Shlomo Yona <shlomo at cs.haifa.ac.il>
> >Reply-To: Perl in Israel <perl at perl.org.il>
> >To: Perl in Israel <perl at perl.org.il>
> >Subject: Re: [Israel.pm] How to open a file on a network drive, using
> >Date: Mon, 3 May 2004 20:11:27 +0300 (IDT)
> >On Mon, 3 May 2004, Gabor Szabo wrote:
> > > On Mon, 3 May 2004, roi sh wrote:
> > >
> > > > yes: the error is : no such file or directory.
> > > >
> > > > please note, that running from the network itself, the directory
> > > > is recognized.
> > > >
> > >
> > > Well, then it seems you are not accesing the correct file or the
> > > path to it is missing. Now what I think we need is the string of
> > > the filename as you pass to open:
> > >
> > > open FH, $filename; # send us what $filename contains
> >open FH, $filename or die "Cannot open |$filename| for reading: $!\n";
> >Will send to your error log (or to the place STDERR is redirected to).
> >This will print the content of $filename and the reason of failure if
> >one occurs.
> >Shlomo Yona
> >shlomo at cs.haifa.ac.il
> >Perl mailing list
> >Perl at perl.org.il
>The new MSN 8: smart spam protection and 2 months FREE*
>Perl mailing list
>Perl at perl.org.il
>This e-mail message has been sent by Elop Electro-Optics industries LTD.
>and is for the use of the intended recipients only.
>The message may contain privileged or confidential information .
>If you are not the intended recipient you are hereby notified that any use,
>distribution or copying of this communication is strictly prohibited,
>and you are requested to delete the e-mail and any attachments
>and notify the sender immediately.
Tired of spam? Get advanced junk mail protection with MSN 8.
More information about the Perl