Re: [PHP-DEV] zip stream looping issue

2013-01-07 Thread Pierre Joye
hi,

On Thu, Jan 3, 2013 at 4:59 PM, Steve Hanselman ste...@brendata.co.uk wrote:
 Before I look into this further, can someone confirm that fopen on a zip
 stream should return something other than a null?

Can you open a bug please and add a link to the zip file you use?

--
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] zip stream looping issue

2013-01-03 Thread Steve Hanselman
Before I look into this further, can someone confirm that fopen on a zip
stream should return something other than a null?



I've a zip called test.zip which contains 5 files,
a.txt,b.txt,c.txt,d.txt and yes, e.txt



The zip is valid and can be unzipped using unzip on linux.



Running the following code returns a null for each of the pointers reads
the first and 2nd files and finally loops somewhere in the fgets code at
100% cpu at the end of b.txt:-



$names=array('a.txt',

'b.txt',

'c.txt',

'd.txt',

'e.txt');



foreach($names as $name)

{

$fp=fopen('zip:///tmp/test.zip#'.$name,'r');

echo $name.':'.var_export($fp).\n;

while(!feof($fp))

{

$r=fgets($fp);

echo '.';

};

fclose($fp);

};



The information contained in this email is intended for the personal and 
confidential use
of the addressee only. It may also be privileged information. If you are not 
the intended
recipient then you are hereby notified that you have received this document in 
error and
that any review, distribution or copying of this document is strictly 
prohibited. If you have
received  this communication in error, please notify Brendata immediately on:

+44 (0)1268 466100, or email 'techni...@brendata.co.uk'

Brendata (UK) Ltd
Nevendon Hall, Nevendon Road, Basildon, Essex. SS13 1BX  UK
Registered Office as above. Registered in England No. 2764339

See our current vacancies at www.brendata.co.uk