[Israel.pm] How to open a file on a network drive, using CGI.

roi sh roi__ at hotmail.com
Tue May 4 00:17:00 PDT 2004


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 directory 
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 CGI.
>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*  

More information about the Perl mailing list