STREAMZIP(1)

πŸ“¦ version 2.220.0, in opensuse-leap 16.0

🌈 STREAMZIP(1) β€” like, the streamzip page, but make it make sense πŸ’…

okay bestie, welcome to STREAMZIP(1) from the User Contributed Perl Documentation crew β€” this is the whole manual, but in a voice you'll actually enjoy reading. let's go ✨


πŸ’– NAME

streamzip β€” bestie, it makes a zip file out of stdin. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS

    producer | streamzip [opts] | consumer
    producer | streamzip [opts] -zipfile=output.zip

like, producer on the left, consumer on the right, streamzip in the middle holding it all together. main character energy fr fr. πŸ‘‘


🌸 DESCRIPTION

so this program reads data from stdin, squishes it into a zip container, and β€” by default β€” writes a streamed zip file straight out to stdout. and the iconic part? no temporary files are created. not one. zero. clean. 🧚

now, the zip container it writes to stdout is, by necessity, written in streaming format. most programs that read Zip files can totally cope with a streamed zip file, no drama. but β€” and this is the lowkey important bit β€” if interoperability matters to you, and your workflow lets you write the zip file directly to disk, you can create a non-streamed zip file using the zipfile option instead. slay. πŸ’…

✨ OPTIONS

  • -zip64 β€” makes a Zip64-compliant zip container. use this one if your input is bigger than 4Gig. default is disabled (so, off unless you say otherwise). πŸ’€
  • -zipfile=F β€” writes the zip container to the filename F. and if you want to force a streamed zip file anyway? use the Stream option for that. 🫢
  • -member-name=M β€” this is the option that names the "file" inside the zip container. default is -. yes, literally a dash. iconic. πŸ“
  • -stream β€” ignored when writing to stdout. but if the zipfile option is specified, including this option will trigger the creation of a streamed zip file. default: always enabled when writing to stdout, otherwise disabled. πŸ¦‹
  • -method=M β€” compress using method M. the valid method names are:
    • store β€” store without compression
    • deflate β€” use Deflate compression [Default]
    • bzip2 β€” use Bzip2 compression
    • lzma β€” use LZMA compression
    • xz β€” use xz compression
    • zstd β€” use Zstandard compression
heads up bestie: Lzma compress needs IO::Compress::Lzma to be installed. πŸ‘€ also heads up: 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 for deflate. ignored for all other compression methods, sorry not sorry. -0 means no compression and -9 means maximum compression. default is 6. πŸ”₯
  • -version β€” display version number ⭐
  • -help β€” display help 🌸

πŸŽ€ Examples

create a zip file by reading data from stdin:

    $ 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 where the member name is not given. no cap. πŸ™ˆ

if you want to explicitly name the file, use the -member-name option like this:

    $ 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

see? latin. named. gorgeous. ✨

πŸ’œ When to write a Streamed Zip File

a Streamed Zip File is useful in situations where you cannot seek backwards/forwards in the file. like, you just can't. it's not happening. 😭

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. chef's kiss. 🫢

similarly, if your workflow uses a Linux pipelined commands. yep, that too. πŸ¦‹


πŸ”₯ 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>. they literally want to hear from you, bestie. πŸ’Œ


πŸ‘‘ AUTHOR

Paul Marquess pmqs@cpan.org. iconic behavior. 🌟


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. periodt. πŸ’…


and that's the whole page, bestie β€” written from the perl v5.42.0 docs, dated 2026-05-17, and yes that's the STREAMZIP(1) footer, folded into this cute little sign-off so you don't have to stare at a boring line at the bottom. mwah. 😘

πŸ“¦ where this page comes from