help with stream filter
| From: | 白浩平 | Date: | Thu, 23 Jul 2009 02:20:48 +0000 |
| Subject: | help with stream filter | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-295725@lists.php.net to get a copy of this message | ||
Hi, everyone
Has anyone tried to use stream filter to decompress a large file?
My problem when doing this is memory consume.
My php process requires more and more memory as time goes. Is this a bug or
just I don’t get the right usage?
My code as follows:
26 $fp = fopen ( $filename, 'r' );
27 $filter = stream_filter_append($fp, 'bzip2.decompress',
STREAM_FILTER_READ);
28
29 $counter = 0;
30 while ( ! feof ( $fp ) )
31 {
32 $counter ++;
33 $line = fgets ( $fp );
Thanks!