in reply to crc error in zip archive using addMember()

Gulliver:

The only suspect I can think of at the moment is that the original ZIP file is corrupt (as can happen when transferring via FTP in ASCII mode, etc.).

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: crc error in zip archive using addMember()

Replies are listed 'Best First'.
Re^2: crc error in zip archive using addMember()
by Gulliver (Monk) on Dec 06, 2010 at 19:56 UTC

    I'm going to turn this in as a bug in Archive::Zip.

    Update:

    It isn't a bug, just a lack of understanding on my part. I kept going through the documentation for Archive::Zip and noticed where it says when you read an archive it is not read into memory. So when I get a member object for a file with the removeMember method it is actually just an object with a file offset into the zip file. As soon as I save the updated version of that zip file the offset is invalid.

    To make my original code work all I needed to do was save the second zip before the first one.