ID:               50001
 Updated by:       srina...@php.net
 Reported By:      onzi at ustrem dot org
 Status:           Feedback
 Bug Type:         Zlib Related
 Operating System: AIX 6.1
 PHP Version:      5.2.11
 New Comment:

long story short, by any chance , your PHP compile flags include
-D_FILE_OFFSET_BITS=64 option ? if yes, then the below mentioned error
will happen ?


Previous Comments:
------------------------------------------------------------------------

[2009-10-26 22:46:13] j...@php.net

Exactly what is the zlib version in your system you linked PHP with?

------------------------------------------------------------------------

[2009-10-26 15:48:01] onzi at ustrem dot org

Read "Expected Result" as "Actual Result"

Sorry

------------------------------------------------------------------------

[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

Reply via email to