zlib.inflate vs. gzopen/fread

This is a discussion on zlib.inflate vs. gzopen/fread within the PHP General forums, part of the PHP Programming Forums category; Hi all, I've run into a peculiar situation where the inflate implementation in the zlib.inflate filter fails to ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-09-2007
Gregory Beaver
 
Posts: n/a
Default zlib.inflate vs. gzopen/fread

Hi all,

I've run into a peculiar situation where the inflate implementation in
the zlib.inflate filter fails to successfully inflate a gzipped file
created using gzopen/gzwrite. The file is really quite simple. To
replicate, download http://pear.php.net/get/PEAR-1.6.1.tgz and run this
script:

<?php
$fp = fopen('PEAR-1.6.1.tgz', 'rb');
stream_filter_append($fp, 'zlib.inflate');
var_dump(fread($fp, 2000), feof($fp));
fclose($fp);
?>

output is:

string(0) ""
bool(false)

The results are the same when using file_get_contents(), readfile(), and
also with the zlib.inflate example in the PHP manual. This is on a
64-bit system with PHP 5.2.4 CVS HEAD, although the zlib.inflate
implementation hasn't changed substantially since 2005 (and yes, I also
tested it without the 3-line patch introduced in PHP 5.2.1 to see if it
was the cause).

Can anyone else confirm the above behavior?

Thanks,
Greg
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:50 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0