STREAMZIP(1)
๐ STREAMZIP(1) ๐
Okay bestie, welcome to STREAMZIP(1) from the Perl Programmers Reference Guide โ itโs giving โpipe your data in, get a zip out, no temp files, no drama.โ ๐ซถ
๐ธ NAME ๐ธ
streamzip โ create a zip file from stdin
โจ SYNOPSIS โจ
producer | streamzip [opts] | consumer
producer | streamzip [opts] -zipfile=output.zip
๐ DESCRIPTION ๐
Okay so the whole gig: streamzip reads data from stdin, compresses it into a zip container, and by default writes a streamed zip file to stdout. No temporary files are created. Periodt. ๐
The zip container written to stdout is, by necessity, written in streaming format. Most programs that read Zip files can cope with a streamed zip file, but if interoperability is important, and your workflow allows you to write the zip file directly to disk, you can create a non-streamed zip file using the zipfile option. โจ
๐ OPTIONS ๐
Full menu, bestie โ every flag stays exactly as written. No skips, no merges, no invented options. ๐ซถ
-zip64โ Create a Zip64-compliant zip container. Use this option if the input is greater than4Gig. Default is disabled.-zipfile=Fโ Write zip container to the filenameF. Use theStreamoption to force the creation of a streamed zip file.-member-name=Mโ This option is used to name thefilein the zip container. Default is-.-streamโ Ignored when writing tostdout. 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. 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
Note that Lzma compress needs IO::Compress::Lzma to be installed.
Note that Zstd compress needs IO::Compress::Zstd to 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.-0means no compression and-9for maximum compression. Default is6.-versionโ Display version number.-helpโ Display help.
๐ Examples ๐
First up, the page says: Create a zip file bt reading daa from stdin โ yes, thatโs the exact wording, and we respect the lore. ๐
$ echo Lorem ipsum dolor sit | perl ./bin/streamzip >abcd.zip
Check 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โs the default for a few zip utilities when the member name isnโt 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. ๐ฅ
A good example is when youโre serving dynamic content from a Web Server straight into a socket without needing to create a temporary zip file in the filesystem. Literally iconic for pipelines. ๐
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) or https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress.
๐ AUTHOR ๐
Paul Marquess pmqs@cpan.org. Main character energy, no cap. ๐
โญ 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.
Source/version check, bestie: perl v5.42.3, dated 2026-11-03 โ thatโs the whole page, now go make some zip files and slay ๐
โจ
๐ฆ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms