Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

unzip-6.0/man/zipinfo.1  view on Meta::CPAN

.X ",,rw,       1.0 hpf    3710 b- i4:3 26-Jun-92 23:33 makefile.os2"
.X ",,rw,       1.0 hpf    8753 b- i8:3 26-Jun-92 15:29 os2unzip.c"
.X ",,rw,       1.0 hpf      98 b- stor 21-Aug-91 15:34 unzip.def"
.X ",,rw,       1.0 hpf      95 b- stor 21-Aug-91 17:51 zipinfo.def"
.X "5 files, 13386 bytes uncompressed, 4951 bytes compressed:  63.0%"
.PP
The header line gives the name of the archive, its total size, and the
total number of files; the trailer gives the number of files listed,
their total uncompressed size, and their total compressed size (not
including any of \fIzip\fP's internal overhead).  If, however, one or
more \fIfile(s)\fP are provided, the header and trailer lines are
not listed.  This behavior is also similar to that of Unix's ``\fCls \-l\fR'';
it may be overridden by specifying the \fB\-h\fP and \fB\-t\fP options
explicitly.
In such a case the listing format must also be specified explicitly,
since \fB\-h\fP or \fB\-t\fP (or both) in the absence of other options implies
that ONLY the header or trailer line (or both) is listed.  See the
\fBEXAMPLES\fP section below for a semi-intelligible translation of this
nonsense.
.PP
The verbose listing is mostly self-explanatory.  It also lists file
comments and the zipfile comment, if any, and the type and number of bytes
in any stored extra fields.  Currently known types of extra fields include
PKWARE's authentication (``AV'') info; OS/2 extended attributes; VMS
filesystem info, both PKWARE and Info-ZIP versions; Macintosh resource
forks; Acorn/Archimedes SparkFS info; and so on.  (Note
that in the case of OS/2 extended attributes--perhaps the most common
use of zipfile extra fields--the size of the stored EAs as reported by
\fIzipinfo\fP may not match the number given by OS/2's \fIdir\fP command:
OS/2 always reports the number of bytes required in 16-bit format, whereas
\fIzipinfo\fP always reports the 32-bit storage.)
.PP
Again, the compressed size figures of the individual entries include the
12 extra header bytes for encrypted entries.  In contrast, the archive total
compressed size and the average compression ratio shown in the summary
bottom line are calculated \fBwithout\fP the extra 12 header bytes of
encrypted entries.
.PD
.\" =========================================================================
.SH "ENVIRONMENT OPTIONS"
Modifying \fIzipinfo\fP's default behavior via options placed in
an environment variable can be a bit complicated to explain, due to
\fIzipinfo\fP's attempts to handle various defaults in an intuitive,
yet Unix-like, manner.  (Try not to laugh.)  Nevertheless, there is some
underlying logic.  In brief,
there are three ``priority levels'' of options:  the default options;
environment options, which can override or add to the defaults; and
explicit options given by the user, which can override or add to
either of the above.
.PP
The default listing format, as noted above, corresponds roughly
to the "\fCzipinfo \-hst\fR" command (except when individual zipfile members
are specified).
A user who prefers the long-listing format (\fB\-l\fP) can make use of the
\fIzipinfo\fP's environment variable to change this default:
.TP
Unix Bourne shell:
\f(CW\&ZIPINFO=\-l; export ZIPINFO\fP
.TP
Unix C shell:
\f(CW\&setenv ZIPINFO \-l\fP
.TP
OS/2 or MS-DOS:
\f(CW\&set ZIPINFO=\-l\fP
.TP
VMS (quotes for \fIlowercase\fP):
\f(CW\&define ZIPINFO_OPTS "\-l"\fP
.EE
.PP
If, in addition, the user dislikes the trailer line, \fIzipinfo\fP's
concept of ``negative options'' may be used to override the default
inclusion of the line.  This is accomplished by preceding the undesired
option with one or more minuses:  e.g., ``\fC\-l\-t\fR'' or ``\fC\-\-tl\fR'',
in this example.  The first hyphen is the regular switch character, but the
one before the `t' is a minus sign.  The dual use of hyphens may seem a
little awkward, but it's reasonably intuitive nonetheless:  simply ignore
the first hyphen and go from there.  It is also consistent with the behavior
of the Unix command \fInice\fP(1).
.PP
As suggested above, the default variable names are ZIPINFO_OPTS for VMS
(where the symbol used to install \fIzipinfo\fP as a foreign command
would otherwise be confused with the environment variable), and ZIPINFO
for all other operating systems.  For compatibility with \fIzip\fP(1L),
ZIPINFOOPT is also accepted (don't ask).  If both ZIPINFO and ZIPINFOOPT
are defined, however, ZIPINFO takes precedence.  \fIunzip\fP's diagnostic
option (\fB\-v\fP with no zipfile name) can be used to check the values
of all four possible \fIunzip\fP and \fIzipinfo\fP environment variables.
.PD
.\" =========================================================================
.SH EXAMPLES
To get a basic, short-format listing of the complete contents of a ZIP
archive \fIstorage.zip\fP, with both header and totals lines, use only
the archive name as an argument to zipinfo:
.PP
.EX
zipinfo storage
.EE
.PP
To produce a basic, long-format listing (not verbose), including header and
totals lines, use \fB\-l\fP:
.PP
.EX
zipinfo \-l storage
.EE
.PP
To list the complete contents of the archive without header and totals
lines, either negate the \fB\-h\fP and \fB\-t\fP options or else specify the
contents explicitly:
.PP
.EX
zipinfo \-\-h\-t storage
zipinfo storage \e*
.EE
.PP
(where the backslash is required only if the shell would otherwise expand
the `*' wildcard, as in Unix when globbing is turned on--double quotes around
the asterisk would have worked as well).  To turn off the totals line by
default, use the environment variable (C shell is assumed here):
.PP
.EX
setenv ZIPINFO \-\-t
zipinfo storage
.EE
.PP
To get the full, short-format listing of the first example again, given
that the environment variable is set as in the previous example, it is
necessary to specify the \fB\-s\fP option explicitly, since the \fB\-t\fP
option by itself implies that ONLY the footer line is to be printed:
.PP
.EX
setenv ZIPINFO \-\-t
zipinfo \-t storage            \fR[only totals line]\fP
zipinfo \-st storage           \fR[full listing]\fP
.EE
.PP
The \fB\-s\fP option, like \fB\-m\fP and \fB\-l\fP, includes headers and
footers by default, unless otherwise specified.  Since the environment
variable specified no footers and that has a higher precedence than the
default behavior of \fB\-s\fP, an explicit \fB\-t\fP option was necessary
to produce the full listing.  Nothing was indicated about the header,
however, so the \fB\-s\fP option was sufficient.  Note that both the
\fB\-h\fP and \fB\-t\fP options, when used by themselves or with
each other, override any default listing of member files; only the header
and/or footer are printed.  This behavior is useful when \fIzipinfo\fP is
used with a wildcard zipfile specification; the contents of all zipfiles
are then summarized with a single command.
.PP
To list information on a single file within the archive, in medium format,
specify the filename explicitly:
.PP
.EX
zipinfo \-m storage unshrink.c
.EE
.PP
The specification of any member file, as in this example, will override
the default header and totals lines; only the single line of information
about the requested file will be printed.  This is intuitively what one
would expect when requesting information about a single file.  For multiple
files, it is often useful to know the total compressed and uncompressed
size; in such cases \fB\-t\fP may be specified explicitly:
.PP
.EX
zipinfo \-mt storage "*.[ch]" Mak\e*
.EE
.PP
To get maximal information about the ZIP archive, use the verbose
option.  It is usually wise to pipe the output into a filter such as
Unix \fImore\fP(1) if the operating system allows it:
.PP
.EX
zipinfo \-v storage | more
.EE
.PP
Finally, to see the most recently modified files in the archive, use
the \fB\-T\fP option in conjunction with an external sorting utility
such as Unix \fIsort\fP(1) (and \fIsed\fP(1) as well, in this example):
.PP
.EX
zipinfo \-T storage | sort -nr -k 7 | sed 15q
.EE
.PP
The \fB\-nr\fP option to \fIsort\fP(1) tells it to sort numerically
in reverse order rather than in textual order, and the \fB\-k\ 7\fP option
tells it to sort on the seventh field.  This
assumes the default short-listing format; if \fB\-m\fP or \fB\-l\fP is
used, the proper \fIsort\fP(1) option would be \fB\-k\ 8\fP.
Older versions of \fIsort\fP(1) do not support the \fB\-k\fP option,
but you can use the traditional \fB\+\fP option instead, e.g.,
\fB\+6\fP instead of \fB\-k\ 7\fP.  The \fIsed\fP(1)
command filters out all but the first 15 lines of the listing.  Future
releases of \fIzipinfo\fP may incorporate date/time and filename sorting



( run in 2.033 seconds using v1.01-cache-2.11-cpan-13bb782fe5a )