STREAMZIP(1p)
π NAME π
streamzip β bestie, it creates a zip file from stdin. That's the whole β¨thingβ¨. This is the 1p page for it, obviously, so you know it's a perl situation.
π¦ SYNOPSIS π¦
producer | streamzip [opts] | consumer
producer | streamzip [opts] -zipfile=output.zip
πΈ DESCRIPTION πΈ
okay so picture this: this program reads data off stdin, squishes it into a zip container, and by default writes a streamed zip file straight to stdout. And the iconique part? No temporary files are created. Not one. Not ever. π
Now, the zip container that lands on stdout is, by necessity, written in streaming format. Most programs that read Zip files can cope with a streamed zip file, no cap. But β and this is the part where you listen to me β if interoperability is important to you, and your workflow lets you write the zip file directly to disk, then you can create a non-streamed zip file using the zipfile option. π
β¨ OPTIONS β¨
-zip64β creates a Zip64-compliant zip container. Use this one if your input is greater than 4Gig, because otherwise, babe, it's not gonna fit. Default is disabled.-zipfile=Fβ writes the zip container to the filenameF, instead of the defaultstdoutsituation. Use theStreamoption to force the creation of a streamed zip file. ποΈ-member-name=Mβ this is the one that names thefileinside the zip container. Default is-. (Yes, literally a dash. We'll get into why later, stay with me.)-streamβ ignored when writing tostdout(it's already doing that, bestie). If thezipfileoption is specified, including this option will trigger the creation of a streamed zip file. Default: always enabled when writing tostdout, otherwise disabled.-method=Mβ compress using methodM. π§ The valid method names are:storeβ Store without compressiondeflateβ Use Deflate compression [Default]bzip2β Use Bzip2 compressionlzmaβ Use LZMA compressionxzβ Use xz compressionzstdβ Use Zstandard compression
Heads up: Lzma compress needsIO::Compress::Lzmato be installed. Also heads up: Zstd compress needsIO::Compress::Zstdto be installed.
Default is deflate. β
-0,-1,-2,-3,-4,-5,-6,-7,-8,-9β sets the compression level fordeflate. Ignored for all other compression methods, so don't come crying to me when-9does nothing onbzip2.-0means no compression and-9is for maximum compression. Default is6.-versionβ display version number π-helpβ display help π«Ά
π Examples π
Making a zip file by reading data from stdin:
$ echo Lorem ipsum dolor sit | perl ./bin/streamzip >abcd.zip
Checking the contents of abcd,zip with the standard unzip utility:
Archive: abcd.zip
Length Date Time Name
--------- ---------- ----- ----
22 2021-01-08 19:45 -
--------- -------
22 1 file
Notice how the Name is set to -. That is the default for a few zip utilities where the member name is not given. π
If you want to explicitly name the file, use the -member-name option as follows:
$ echo Lorem ipsum dolor sit | perl ./bin/streamzip -member-name latin >abcd.zip
$ unzip -l abcd.zip
Archive: abcd.zip
Length Date Time Name
--------- ---------- ----- ----
22 2021-01-08 19:47 latin
--------- -------
22 1 file
π§ When to write a Streamed Zip File π§
A Streamed Zip File is useful in situations where you cannot seek backwards/forwards in the file. Literally cannot. No seeking. π«
A good example is when you are serving dynamic content from a Web Server straight into a socket without needing to create a temporary zip file in the filesystem. Main character energy, truly. β¨
Similarly if your workflow uses a Linux pipelined commands. π§
π«Ά SUPPORT π«Ά
General feedback/questions/bug reports should be sent to <https://github.com/pmqs/IO-Compress/issues> (preferred, bestie, they love it there) or <https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>. Don't be shy. πΈ
π AUTHOR π
Paul Marquess pmqs@cpan.org.
π COPYRIGHT π
Copyright (c) 2019-2026 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the tea, babe β this page is from perl v5.40.1, dated 2026-07-04, filed under STREAMZIP(1p). go forth and pipe something, ily π
π¦ where this page comes from
- ubuntu stonking: libio-compress-perl 2.223-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms