in reply to Re^3: unable to extract same file twice using Archive::Zip
in thread unable to extract same file twice using Archive::Zip

I must extract the file from the archive twice as i cannot copy the extracted version to the second location

Of course I can. Ihe problem is that I don't wanted to always remember what already has been extracted, let it stay on the disk, reuse it, if even necessary, and cleanup later. Extracting it a second time if I already know that it's needed and don't have to look if it's already extracted would have been less code.

Forgive me, but I don't understand. I would gladly offer whatever help I can provide, but this problem your facing doesn't make sense... please clarify

The main question is: Is there a limitation on how often one can extract the same zip member and if, why? I don't see any reason why one shouldn't be able to extract a member more than once, if he wants to.

If this approach is unsuitable, why not?

In my mind it's waste of space to extract everything at once if I always just need one or two files from the archive. If there are two same named files in the archive you get a problem, too.

But as I said before, I really would like to know if it's possible to extract a member more than once or not. Maybe I'm just missing something like endRead in the proper way or stuff like that.

  • Comment on Re^4: unable to extract same file twice using Archive::Zip

Replies are listed 'Best First'.
Re^5: unable to extract same file twice using Archive::Zip
by desemondo (Hermit) on Jul 07, 2010 at 02:31 UTC
    I don't think you tested your example somehow, theres a typo in your method call extractToFileNames() should actually be extractToFileNamed().

    Having modifed that, your example works perfectly fine for me on winXP, perl 5.8.8, zip.pm v1.20 - perhaps you've found some sort of regression bug. What versions are you using? And what actually happens when you attempt to extract a member twice? (Maybe paste the console output into a <code></code> block)

    BTW, since your example didn't include it, are your using use strict; use warnings;

      Having modifed that, your example works perfectly fine for me on winXP, perl 5.8.8, zip.pm v1.20

      That's what I wanted to read, thanks. Seems it should work, but it doesn't for me. I have version 1.30 on Perl 5.10.1.1007 on Win Server 2003 R2 SP2.