Open file works under DOS, not under server 
Author Message
 Open file works under DOS, not under server

: Why does the following code work fine under DOS, but doesn't appear
: to work under the O'Reilly Web Server.  From the server, the file
: doesn't appear to read in any data. Other CGI's seem to work OK.

: $file = "ratedata/comments.txt";

Use the absolute path to the file.  CGI doesn't know where it is.

--
Nathan V. Patwardhan



Sun, 29 Aug 1999 03:00:00 GMT  
 Open file works under DOS, not under server

Quote:

>Why does the following code work fine under DOS, but doesn't appear
>to work under the O'Reilly Web Server.  From the server, the file
>doesn't appear to read in any data. Other CGI's seem to work OK.

>#!/usr/bin/perl

>$file = "ratedata/comments.txt";

WebSite sets the current directory to the CGI working directory you
specified on the General tab.  (Apache and NCSA HTTPd set it to the
directory the script resides in.)

To mimic the Apache or NCSA behavior, I have changed the Standard CGI
Shell on the CGI tab to

perl c:\perlprog\fixpath.pl

where fixpath.pl is the short but sweet script


Note, however, that this is about the same as putting PERL.EXE in your
cgi-bin in terms of security holes you can drive trucks through.  You

a small private web server on a protected network, so this isn't an
issue.

--
Ron Parker
Software Engineer
Farm Works Software       Come see us at http://www.farmworks.com



Tue, 31 Aug 1999 03:00:00 GMT  
 Open file works under DOS, not under server

Quote:

> In Unix
> there is the pwd command, but off the top of my head I can't think of an
> equivalent in DOS.

The cd command prints the current working directory if you don't give
it any arguments.

Markus Laker



Fri, 10 Sep 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Open file works under DOS, not under server

2. Open file works under DOS, not under server

3. Open file works under DOS, not under server

4. Simple DOS/Win95 originated Perl script not working when loaded in the UNIX Server

5. Simple DOS/Win95 originated Perl script not working when loaded in the UNIX Server

6. Send mail script not working in 2nd server but working in 1st server

7. Send mail script not working in 2nd server but working in 1st server

8. Increasing max open files works in C, not perl

9. glob not working in dos

10. open read/write not working in Perl5

11. open w/ pipe not working

12. Open to Pipe does not work in cron

 

 
Powered by phpBB® Forum Software