in reply to Re: Multi file stream with IO::Compress::Zip
in thread Multi file stream with IO::Compress::Zip

What I couldn't figure out is how to specify a new (change of) filename. But see my update above, I went with a different module and it does what I need.
  • Comment on Re^2: Multi file stream with IO::Compress::Zip

Replies are listed 'Best First'.
Re^3: Multi file stream with IO::Compress::Zip
by pmqs (Friar) on Sep 17, 2014 at 09:40 UTC

    If a streamed Zip file with multiple members is what you need then Archive::Zip::SimpleZip is probably the best way to go.

    I see in your code you've used '-' to force streaming. You can explicitly request streaming to a file/buffer by specifying the Stream option, as shown below. If writing to STDOUT is what you need, then you don't need to explicitly set it.

    ## Explicitly ask for Stream is set to 1 my $z = new Archive::Zip::SimpleZip "somefile.zip, Stream => 1 or print STDERR "Cannot create zip file: $SimpleZipError\n";

    FYI - I wrote Archive::Zip::SimpleZip because the interface I provided in IO::Compress::Zip to create a Zip file with multiple members is not the easiest to use. Archive::Zip::SimpleZip is just a wrapper around IO::Compress::Zip to make this use-case as easy as possible.

      I am using Archive::Zip::SimpleZip and it works exactly as needed. Thanks for your work, it's great!