|
Posted by Ben Hallert on 01/10/07 05:46
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!
[Back to original message]
|