zip_read strangeness



Hi!

I'm using the zip functions for the first time and I'm having an odd
problem. I may be doing something boneheaded, here's hoping someone
here can recognize it.

I have a foreach loop that goes through a list of files and is supposed
to generate a list of the contents.

foreach($filelist as $filename)
{
if (($temp = zip_open($local_storage.$filename)))
{
while ($entry = zip_read($temp))
{
$file_name = zip_entry_name($entry);
$file_size = zip_entry_filesize($entry);
$compression = zip_entry_compressionmethod($entry);

echo "Contains: $file_name ($file_size) compressed with
$compression.\n";

//Do stuff
}
zip_close($temp);
}
}

It appears to work, but when I look at the output, I realize that the
info is correct for the _first_ file it iterates through, but each
subsequent file is just showing the same data from the first file
again. I've verified that the zip contents are different. I've tried
manually clearing the strings involved, played around with
zip_open_entry, and so on, but it keeps repeating the info from the
first zip as the data for the rest.

It's late here, maybe I'm missing something obvious. Can anyone tell
me why it might behave like this?

Thanks!

.



Relevant Pages

  • Re: ToolHelp thread count doesnt match debugger
    ... Not odd at all. ... What I thought was odd was the first time I ran it, ... Now what's interesting is that since I have set that flag, my app has ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ToolHelp thread count doesnt match debugger
    ... Not odd at all. ... What I thought was odd was the first time I ran it, ... Now what's interesting is that since I have set that flag, my app has ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ToolHelp thread count doesnt match debugger
    ... Not odd at all. ... What I thought was odd was the first time I ran it, ... Now what's interesting is that since I have set that flag, my app has ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Section break changing to section break continuous
    ... the first time (deleting breaks can cause unexpected results), ... Word MVP FAQ site: http://word.mvps.org ... > Insert->Break, select the "Odd Page" option, click OK. ...
    (microsoft.public.word.formatting.longdocs)
  • Re: even/odd functions
    ... even-function so that I can apply the and test on them? ... even part odd part ... we did notice the stability of parity for n iterates ... do you know functions m without any parity ...
    (sci.math)