Henry Law wrote:
> 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.
Obviously, /tmp/nfb isn't a directory.
> 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.
That's what they always say
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details:
http://www.fujitsu-siemens.com/imprint.html