#50001 [Opn]: gzseek don't working
| From: | onzi at ustrem dot org | Date: | Mon, 26 Oct 2009 15:48:01 +0000 |
| Subject: | #50001 [Opn]: gzseek don't working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143966@lists.php.net to get a copy of this message | ||
ID: 50001
User updated by: onzi at ustrem dot org
Reported By: onzi at ustrem dot org
Status: Open
Bug Type: Zlib Related
Operating System: AIX 6.1
PHP Version: 5.2.11
New Comment:
Read "Expected Result" as "Actual Result"
Sorry
Previous Comments:
------------------------------------------------------------------------
[2009-10-26 15:45:08] onzi at ustrem dot org
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 this bug report at http://bugs.php.net/?id=50001&edit=1