#50001 [NEW]: gzseek don't working
| From: | onzi at ustrem dot org | Date: | Mon, 26 Oct 2009 15:45:08 +0000 |
| Subject: | #50001 [NEW]: gzseek don't working | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-143965@lists.php.net to get a copy of this message | ||
From: onzi at ustrem dot org
Operating system: AIX 6.1
PHP version: 5.2.11
PHP Bug Type: Zlib Related
Bug description: gzseek don't working
Description:
------------
OSlevel 6100-02-03-0909
xlc 10.1.0.0
I run ./sapi/cli/php ext/zlib/tests/gzseek_basic.phpt
gzopen opens file but gzseek seems to not working.
Reproduce code:
---------------
<?php
$f = dirname(__FILE__)."/004.txt.gz";
$h = gzopen($f, 'r');
var_dump($h);
echo "move to the 50th byte\n";
var_dump(gzseek($h,50));
echo "tell=".gztell($h)."\n";
//read the next 10
var_dump(gzread($h, 10));
echo "\nmove forward to the 100th byte\n";
var_dump(gzseek( $h, 100 ) );
echo "tell=".gztell($h)."\n";
//read the next 10
var_dump(gzread($h, 10));
echo "\nmove backward to the 20th byte\n";
var_dump(gzseek( $h, 20 ) );
echo "tell=".gztell($h)."\n";
//read the next 10
var_dump(gzread($h, 10));
gzclose($h);
?>
Expected result:
----------------
resource(5) of type (stream)
move to the 50th byte
int(-1)
tell=
string(0) ""
move forward to the 100th byte
int(-1)
tell=
string(0) ""
move backward to the 20th byte
int(-1)
tell=
string(0) ""
Actual result:
--------------
move to the 50th byte
int(0)
tell=50
string(10) " high abov"
move forward to the 100th byte
int(0)
tell=100
string(10) "Destiny wh"
move backward to the 20th byte
int(0)
tell=20
string(10) "hrough fee"
--
Edit bug report at http://bugs.php.net/?id=50001&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50001&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50001&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50001&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50001&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50001&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50001&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50001&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50001&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50001&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50001&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50001&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50001&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50001&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50001&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50001&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50001&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50001&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50001&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50001&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50001&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50001&r=mysqlcfg