| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "STREAMZIP 1" |
| 58 |
.TH STREAMZIP 1 2026-04-10 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
streamzip \- create a zip file from stdin |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 2 |
| 68 |
\& producer | streamzip [opts] | consumer |
| 69 |
\& producer | streamzip [opts] \-zipfile=output.zip |
| 70 |
.Ve |
| 71 |
.SH DESCRIPTION |
| 72 |
.IX Header "DESCRIPTION" |
| 73 |
This program will read data from \f(CW\*(C`stdin\*(C'\fR, compress it into a zip container |
| 74 |
and, by default, write a \fIstreamed\fR zip file to \f(CW\*(C`stdout\*(C'\fR. No temporary |
| 75 |
files are created. |
| 76 |
.PP |
| 77 |
The zip container written to \f(CW\*(C`stdout\*(C'\fR is, by necessity, written in |
| 78 |
streaming format. Most programs that read Zip files can cope with a |
| 79 |
streamed zip file, but if interoperability is important, and your workflow |
| 80 |
allows you to write the zip file directly to disk you can create a |
| 81 |
non-streamed zip file using the \f(CW\*(C`zipfile\*(C'\fR option. |
| 82 |
.SS OPTIONS |
| 83 |
.IX Subsection "OPTIONS" |
| 84 |
.IP \-zip64 5 |
| 85 |
.IX Item "-zip64" |
| 86 |
Create a Zip64\-compliant zip container. Use this option if the input is |
| 87 |
greater than 4Gig. |
| 88 |
.Sp |
| 89 |
Default is disabled. |
| 90 |
.IP \-zipfile=F 5 |
| 91 |
.IX Item "-zipfile=F" |
| 92 |
Write zip container to the filename \f(CW\*(C`F\*(C'\fR. |
| 93 |
.Sp |
| 94 |
Use the \f(CW\*(C`Stream\*(C'\fR option to force the creation of a streamed zip file. |
| 95 |
.IP \-member\-name=M 5 |
| 96 |
.IX Item "-member-name=M" |
| 97 |
This option is used to name the "file" in the zip container. |
| 98 |
.Sp |
| 99 |
Default is '\-'. |
| 100 |
.IP \-stream 5 |
| 101 |
.IX Item "-stream" |
| 102 |
Ignored when writing to \f(CW\*(C`stdout\*(C'\fR. |
| 103 |
.Sp |
| 104 |
If the \f(CW\*(C`zipfile\*(C'\fR option is specified, including this option will trigger |
| 105 |
the creation of a streamed zip file. |
| 106 |
.Sp |
| 107 |
Default: Always enabled when writing to \f(CW\*(C`stdout\*(C'\fR, otherwise disabled. |
| 108 |
.IP \-method=M 5 |
| 109 |
.IX Item "-method=M" |
| 110 |
Compress using method \f(CW\*(C`M\*(C'\fR. |
| 111 |
.Sp |
| 112 |
Valid method names are |
| 113 |
.Sp |
| 114 |
.Vb 6 |
| 115 |
\& * store Store without compression |
| 116 |
\& * deflate Use Deflate compression [Deflault] |
| 117 |
\& * bzip2 Use Bzip2 compression |
| 118 |
\& * lzma Use LZMA compression |
| 119 |
\& * xz Use xz compression |
| 120 |
\& * zstd Use Zstandard compression |
| 121 |
.Ve |
| 122 |
.Sp |
| 123 |
Note that Lzma compress needs \f(CW\*(C`IO::Compress::Lzma\*(C'\fR to be installed. |
| 124 |
.Sp |
| 125 |
Note that Zstd compress needs \f(CW\*(C`IO::Compress::Zstd\*(C'\fR to be installed. |
| 126 |
.Sp |
| 127 |
Default is \f(CW\*(C`deflate\*(C'\fR. |
| 128 |
.IP "\-0, \-1, \-2, \-3, \-4, \-5, \-6, \-7, \-8, \-9" 5 |
| 129 |
.IX Item "-0, -1, -2, -3, -4, -5, -6, -7, -8, -9" |
| 130 |
Sets the compression level for \f(CW\*(C`deflate\*(C'\fR. Ignored for all other compression methods. |
| 131 |
.Sp |
| 132 |
\&\f(CW\-0\fR means no compression and \f(CW\-9\fR for maximum compression. |
| 133 |
.Sp |
| 134 |
Default is 6 |
| 135 |
.IP \-version 5 |
| 136 |
.IX Item "-version" |
| 137 |
Display version number |
| 138 |
.IP \-help 5 |
| 139 |
.IX Item "-help" |
| 140 |
Display help |
| 141 |
.SS Examples |
| 142 |
.IX Subsection "Examples" |
| 143 |
Create a zip file bt reading daa from stdin |
| 144 |
.PP |
| 145 |
.Vb 1 |
| 146 |
\& $ echo Lorem ipsum dolor sit | perl ./bin/streamzip >abcd.zip |
| 147 |
.Ve |
| 148 |
.PP |
| 149 |
Check the contents of \f(CW\*(C`abcd,zip\*(C'\fR with the standard \f(CW\*(C`unzip\*(C'\fR utility |
| 150 |
.PP |
| 151 |
.Vb 6 |
| 152 |
\& Archive: abcd.zip |
| 153 |
\& Length Date Time Name |
| 154 |
\& \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- \-\-\-\-\- \-\-\-\- |
| 155 |
\& 22 2021\-01\-08 19:45 \- |
| 156 |
\& \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- |
| 157 |
\& 22 1 file |
| 158 |
.Ve |
| 159 |
.PP |
| 160 |
Notice how the \f(CW\*(C`Name\*(C'\fR is set to \f(CW\*(C`\-\*(C'\fR. |
| 161 |
That is the default for a few zip utilities whwre the member name is not given. |
| 162 |
.PP |
| 163 |
If you want to explicitly name the file, use the \f(CW\*(C`\-member\-name\*(C'\fR option as follows |
| 164 |
.PP |
| 165 |
.Vb 1 |
| 166 |
\& $ echo Lorem ipsum dolor sit | perl ./bin/streamzip \-member\-name latin >abcd.zip |
| 167 |
\& |
| 168 |
\& $ unzip \-l abcd.zip |
| 169 |
\& Archive: abcd.zip |
| 170 |
\& Length Date Time Name |
| 171 |
\& \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- \-\-\-\-\- \-\-\-\- |
| 172 |
\& 22 2021\-01\-08 19:47 latin |
| 173 |
\& \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- |
| 174 |
\& 22 1 file |
| 175 |
.Ve |
| 176 |
.SS "When to write a Streamed Zip File" |
| 177 |
.IX Subsection "When to write a Streamed Zip File" |
| 178 |
A Streamed Zip File is useful in situations where you cannot seek |
| 179 |
backwards/forwards in the file. |
| 180 |
.PP |
| 181 |
A good examples is when you are serving dynamic content from a Web Server |
| 182 |
straight into a socket without needing to create a temporary zip file in |
| 183 |
the filesystsm. |
| 184 |
.PP |
| 185 |
Similarly if your workfow uses a Linux pipelined commands. |
| 186 |
.SH SUPPORT |
| 187 |
.IX Header "SUPPORT" |
| 188 |
General feedback/questions/bug reports should be sent to |
| 189 |
<https://github.com/pmqs/IO\-Compress/issues> (preferred) or |
| 190 |
<https://rt.cpan.org/Public/Dist/Display.html?Name=IO\-Compress>. |
| 191 |
.SH AUTHOR |
| 192 |
.IX Header "AUTHOR" |
| 193 |
Paul Marquess \[email protected]\fR. |
| 194 |
.SH COPYRIGHT |
| 195 |
.IX Header "COPYRIGHT" |
| 196 |
Copyright (c) 2019\-2024 Paul Marquess. All rights reserved. |
| 197 |
.PP |
| 198 |
This program is free software; you can redistribute it and/or modify it |
| 199 |
under the same terms as Perl itself. |