Re: temp files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, July 25, 2007 3:55 am, admin wrote:
> $lines = gzfile("http://www.example.com/some/resource";);
>
> for its internal needs gzfile() creates a temp file such as
> /var/tmp/phpFjJxNX where the gzipped resource is kept. The file stays
> there forever and eventually the fs runs out of inodes. Any way to
> unlink the temp file from the script? I've found no api for that.
> Alternative code:
>
> $lines = file("compress.zlib://http://www.example.com/some/resource";);
>
> does the same thing still leaving the file around.
>
> Using PHP 4.3.3RC4 (built: Aug 24 2003 14:59:14)
> This could be a bug, but upgrading is not an option.

$files = glob('/var/tmp/php*');
foreach($files as $file){
  if (fileatime($file) < time() - 60*60*24*7) unlink($file);
}

You're on your own to convert that into something PHP 4.3.3RC4 can
actually do with:
http://php.net/readdir


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux