"copy" from File::Copy fails but returns success



The CGI program, running under Apache, supports download of a file from a Linux server running Perl 5.8.6. The files are stored compressed, so the download program first copies the compressed file to a temporary directory, then uncompresses it and handles the HTTP for the download. My problem is that the use of "copy" from File::Copy appears to succeed (with a TRUE return code) but then when I go to uncompress the file it's not there.

Because of the CGI environment it's hard to give a fully-runnable fragment, but here's the core of it.

$rc = copy ("/home/nfb/temp.txt", "/tmp/nfb");
my $output = "Return code:$rc<br>" . `ls -l /tmp/nfb`;
print "Content-type: text/html\n\n<html><body><p>$output</p></body></html>\n";
exit 0;

The source file exists and is chmod 777. The result from the code above is

Return code:1
-rw-r--r-- 1 apache apache 5 Oct 16 09:34 /tmp/nfb

.... which shows that the copy succeeded (return code 1) but the file is nevertheless not in the target directory /tmp/nfb. I'm baffled.

Any ideas? If you think it's a Linux or Apache configuration problem then please say so and I'll take this to the relevant group; but this code worked a few weeks ago and I've not touched the Apache configuration since.

--

Henry Law Manchester, England
.



Relevant Pages

  • Re: IE cannot open MS Office files over SSL connection, no problem in Firefox
    ... > I have a secured web environment running Apache 1.3.33 and Tomcat 5.5.9 ... > These users can download any other types of files from this page (i.e. ... standards-compliant implementation of TLS that does not fail when extensions ...
    (comp.lang.java.help)
  • Re: Bandwidth Monitoring per Directory
    ... Thanks...I'll ask in the apache list too. ... > to log transfer sizes in your access_log ... > a website that I have registered members on. ... > download, and then cancels it after 100k, I need to know they didn't ...
    (RedHat)
  • IE cannot open MS Office files over SSL connection, no problem in Firefox
    ... involves IE, Word Documents, Apache, Tomcat etc, but here goes... ... I have a secured web environment running Apache 1.3.33 and Tomcat 5.5.9 ... These users can download any other types of files from this page (i.e. ...
    (comp.lang.java.help)
  • File Corruption
    ... I originally posted this question to the Apache list and was strongly ... This server is dedicated to hosting files for download through http ... I googled and searched the lists but have only found tips regarding speeding ...
    (freebsd-questions)
  • Simple CGI Script for MPE/ix?
    ... I want to write a simple little COBOL CGI program to run under Apache. ... I have tried using the PRINT intrinsic thinking that might be the right way to go, but it still appears to fail. ... Program runs correctly from the command line, but will fail as a CGI program with a 500 error. ... +5 CALL INTRINSIC "PRINT" USING MSG MSGSIZE MSGCR ...
    (comp.sys.hp.mpe)