in reply to Archive::Zip error when reading a zip file format error: bad signature

There is an assumption that the zip file in question is not corrupted. Have you verified this assumption?

Since you haven't said what you're doing, and the file sizes suggest that all you need to do is read/extract a part of the file. If so, this might be some good information: Per Archive::Zip's documentation:

If you are just going to be extracting zips (and/or other archives) you are recommended to look at using Archive::Extract instead, as it is much easier to use and factors out archive-specific functionality.

A quick search of Archive::Zip doesn't suggest there's a file size ceiling. Can you point that out to me? Are you using the latest?

In the event you have no control over the zip file you're processing, you always have the BigHammer(tm) approach of unzip the file with an external tool, grab what you want, and wipe out the temp folder.

I'm not sure if switching to tar with gzip would get you any traction or not. The heart of tar is designed for dealing with these kinds of massive files. Since you're in a *NIX toolchain for the creation, it might be worth looking at.

You probably already know this, but the underlying filesystem is going to matter. There's an assumption that FAT32 isn't anywhere in the chain, but that is an assumption. Having been burned in the past by overlooking the obvious, I mention this.

  • Comment on Re: Archive::Zip error when reading a zip file format error: bad signature
  • Download Code

Replies are listed 'Best First'.
Re^2: Archive::Zip error when reading a zip file format error: bad signature
by mhd.tahawi (Initiate) on Aug 01, 2014 at 12:55 UTC
    Thank you so much for your reply, I started to feel ignored by the monks
    first of all: I have only tested the zip file through opening it with archive manager. is that considered enough ? and here is what I am really trying to do:

    according to This therad Archive::Zip can only handle up to 4 GB. I have a code that includes zipping functionality and I need to extend it to be able to zip + GB archives.
    I am using IO::Compress::Zip to do that since I can pass an option zip64 => 1 for +4 GB files, but I also need to rename the member files inside the archives after zipping and IO::Compress::Zip doesn't seem to offer this functionality.
    so I thought about zipping with IO::Compress::Zip and renamein member files with Archive::Zip. I ran a little test before I do this to see if it is possible with big archives and that was my original post.

    so in a summary I need a way to create a big archive and then rename member files.
    thank you !
      "I started to feel ignored by the monks "
      "feel ignored" ? ... in just under two hours?

      That may reflect a misunderstanding of how the Monastery works... especially when the question was less than crystal clear (judging by your need to clarify.)

      We're here to help, but the 'free-help' and 'instant-help' domains are not always co-terminus. Have some patience, mhd.tahawi, and recognize that the good Monks are not always instantly available to solve your problems.

      And consider, also, the possibility that reversing the workflow you specified ("create a big archive and then rename member files") would solve your problem without needing to do renames inside the zipfile.


      check Ln42!

        at first I really appreciate you taking out of your personal time to help me out.
        what I said about ignorance was only as an ice breaker, I fully understand how perlmonks work and I really appreciate all the members here.

        unfortunately reversing the work flow is not possible. The files need to be renamed after they are zipped
        Many thanks :)