Stas Bekman wrote:
RobertCZ wrote:
I'm trying to create temp file in PerlFixupHandler using File::Temp, write to it, send it to the client and get the temp file automatically unlinked upon the end of the request.
I keep getting file permission error.
2) you said:
$fh = new File::Temp( DIR => '/tmp/aimcache', UNLINK => 1 );
so by the time the response phase comes, the file is not there anymore.

instead you could use the approach explained here:
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler
or simply use the response phase and sendfile() to send the contents.

This cleanup_register() trick works great, thank you very much, I have spent way too much time on this thing...

I'm not sure why Gerald Richter uses PerlFixupHandler but I guess he has his reason, so I don't want to fool with it. (it's Apache::ImageMagick module I'm trying to port)

I have however one more question (I've posted this in other email, but it's related): In this FixupHandler when I create a new file and use it with $r -> filename ($tmpnam) ,  Apache still thinks size is that of the originally requested file. Is there a way to change it? Thanks again.

- Robert


Reply via email to