Posted by Andrea Scharfe on 04/30/07 08:24
Hi there,
I am writing a PHP script which generates some charts using gnuplot.
This generates quite a large number of temporary image files. My
problem is that I do not know how to delete these images after they
have been loaded and are already displayed at the website.
Everything I have tried so far resulted in that the images were not
displayed at all.
I already tried something like:
sleep(10);
foreach ($images as $i) {
unlink($i);
}
also tried writing a shell script with the same functionality hoping
that starting the shell script in the background (using &) would
terminate the php script before the images were deleted.
Didn't work either.
Does anyone have an idea? I do not want to use a cron job or something
to clean the temporary directory.
Are there any php only solutions to this problem?
Cheers!
Andrea
[Back to original message]
|