"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "zipinfo.txt" of archive unz552xN.exe:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1
2 ZIPINFO(1L) ZIPINFO(1L)
3
4 NAME
5 zipinfo - list detailed information about a ZIP archive
6
7 SYNOPSIS
8 zipinfo [-12smlvhMtTz] file[.zip] [file(s) ...]
9 [-x xfile(s) ...]
10
11 unzip -Z [-12smlvhMtTz] file[.zip] [file(s) ...]
12 [-x xfile(s) ...]
13
14 DESCRIPTION
15 zipinfo lists technical information about files in a ZIP
16 archive, most commonly found on MS-DOS systems. Such
17 information includes file access permissions, encryption
18 status, type of compression, version and operating system
19 or file system of compressing program, and the like. The
20 default behavior (with no options) is to list single-line
21 entries for each file in the archive, with header and
22 trailer lines providing summary information for the entire
23 archive. The format is a cross between Unix ``ls -l'' and
24 ``unzip -v'' output. See DETAILED DESCRIPTION below.
25 Note that zipinfo is the same program as unzip (under
26 Unix, a link to it); on some systems, however, zipinfo
27 support may have been omitted when unzip was compiled.
28
29 ARGUMENTS
30 file[.zip]
31 Path of the ZIP archive(s). If the file specifica-
32 tion is a wildcard, each matching file is processed
33 in an order determined by the operating system (or
34 file system). Only the filename can be a wildcard;
35 the path itself cannot. Wildcard expressions are
36 similar to Unix egrep(1) (regular) expressions and
37 may contain:
38
39 * matches a sequence of 0 or more characters
40
41 ? matches exactly 1 character
42
43 [...] matches any single character found inside
44 the brackets; ranges are specified by a
45 beginning character, a hyphen, and an ending
46 character. If an exclamation point or a
47 caret (`!' or `^') follows the left bracket,
48 then the range of characters within the
49 brackets is complemented (that is, anything
50 except the characters inside the brackets is
51 considered a match). To specify a verbatim
52 left bracket, the three-character sequence
53 ``[[]'' has to be used.
54
55 (Be sure to quote any character that might other-
56 wise be interpreted or modified by the operating
57 system, particularly under Unix and VMS.) If no
58
59 Info-ZIP 28 February 2005 (v2.42) 1
60
61 ZIPINFO(1L) ZIPINFO(1L)
62
63 matches are found, the specification is assumed to
64 be a literal filename; and if that also fails, the
65 suffix .zip is appended. Note that self-extracting
66 ZIP files are supported, as with any other ZIP
67 archive; just specify the .exe suffix (if any)
68 explicitly.
69
70 [file(s)]
71 An optional list of archive members to be pro-
72 cessed, separated by spaces. (VMS versions com-
73 piled with VMSCLI defined must delimit files with
74 commas instead.) Regular expressions (wildcards)
75 may be used to match multiple members; see above.
76 Again, be sure to quote expressions that would oth-
77 erwise be expanded or modified by the operating
78 system.
79
80 [-x xfile(s)]
81 An optional list of archive members to be excluded
82 from processing.
83
84 OPTIONS
85 -1 list filenames only, one per line. This option
86 excludes all others; headers, trailers and zipfile
87 comments are never printed. It is intended for use
88 in Unix shell scripts.
89
90 -2 list filenames only, one per line, but allow head-
91 ers (-h), trailers (-t) and zipfile comments (-z),
92 as well. This option may be useful in cases where
93 the stored filenames are particularly long.
94
95 -s list zipfile info in short Unix ``ls -l'' format.
96 This is the default behavior; see below.
97
98 -m list zipfile info in medium Unix ``ls -l'' format.
99 Identical to the -s output, except that the com-
100 pression factor, expressed as a percentage, is also
101 listed.
102
103 -l list zipfile info in long Unix ``ls -l'' format.
104 As with -m except that the compressed size (in
105 bytes) is printed instead of the compression ratio.
106
107 -v list zipfile information in verbose, multi-page
108 format.
109
110 -h list header line. The archive name, actual size
111 (in bytes) and total number of files is printed.
112
113 -M pipe all output through an internal pager similar
114 to the Unix more(1) command. At the end of a
115 screenful of output, zipinfo pauses with a
116 ``--More--'' prompt; the next screenful may be
117
118 Info-ZIP 28 February 2005 (v2.42) 2
119
120 ZIPINFO(1L) ZIPINFO(1L)
121
122 viewed by pressing the Enter (Return) key or the
123 space bar. zipinfo can be terminated by pressing
124 the ``q'' key and, on some systems, the
125 Enter/Return key. Unlike Unix more(1), there is no
126 forward-searching or editing capability. Also,
127 zipinfo doesn't notice if long lines wrap at the
128 edge of the screen, effectively resulting in the
129 printing of two or more lines and the likelihood
130 that some text will scroll off the top of the
131 screen before being viewed. On some systems the
132 number of available lines on the screen is not
133 detected, in which case zipinfo assumes the height
134 is 24 lines.
135
136 -t list totals for files listed or for all files. The
137 number of files listed, their uncompressed and com-
138 pressed total sizes , and their overall compression
139 factor is printed; or, if only the totals line is
140 being printed, the values for the entire archive
141 are given. The compressed total size does not
142 include the 12 additional header bytes of each
143 encrypted entry. Note that the total compressed
144 (data) size will never match the actual zipfile
145 size, since the latter includes all of the internal
146 zipfile headers in addition to the compressed data.
147
148 -T print the file dates and times in a sortable deci-
149 mal format (yymmdd.hhmmss). The default date for-
150 mat is a more standard, human-readable version with
151 abbreviated month names (see examples below).
152
153 -z include the archive comment (if any) in the list-
154 ing.
155
156 DETAILED DESCRIPTION
157 zipinfo has a number of modes, and its behavior can be
158 rather difficult to fathom if one isn't familiar with Unix
159 ls(1) (or even if one is). The default behavior is to
160 list files in the following format:
161
162 -rw-rws--- 1.9 unx 2802 t- defX 11-Aug-91 13:48 perms.2660
163
164 The last three fields are the modification date and time
165 of the file, and its name. The case of the filename is
166 respected; thus files that come from MS-DOS PKZIP are
167 always capitalized. If the file was zipped with a stored
168 directory name, that is also displayed as part of the
169 filename.
170
171 The second and third fields indicate that the file was
172 zipped under Unix with version 1.9 of zip. Since it comes
173 from Unix, the file permissions at the beginning of the
174 line are printed in Unix format. The uncompressed file-
175 size (2802 in this example) is the fourth field.
176
177 Info-ZIP 28 February 2005 (v2.42) 3
178
179 ZIPINFO(1L) ZIPINFO(1L)
180
181 The fifth field consists of two characters, either of
182 which may take on several values. The first character may
183 be either `t' or `b', indicating that zip believes the
184 file to be text or binary, respectively; but if the file
185 is encrypted, zipinfo notes this fact by capitalizing the
186 character (`T' or `B'). The second character may also
187 take on four values, depending on whether there is an
188 extended local header and/or an ``extra field'' associated
189 with the file (fully explained in PKWare's APPNOTE.TXT,
190 but basically analogous to pragmas in ANSI C--i.e., they
191 provide a standard way to include non-standard information
192 in the archive). If neither exists, the character will be
193 a hyphen (`-'); if there is an extended local header but
194 no extra field, `l'; if the reverse, `x'; and if both
195 exist, `X'. Thus the file in this example is (probably) a
196 text file, is not encrypted, and has neither an extra
197 field nor an extended local header associated with it.
198 The example below, on the other hand, is an encrypted
199 binary file with an extra field:
200
201 RWD,R,R 0.9 vms 168 Bx shrk 9-Aug-91 19:15 perms.0644
202
203 Extra fields are used for various purposes (see discussion
204 of the -v option below) including the storage of VMS file
205 attributes, which is presumably the case here. Note that
206 the file attributes are listed in VMS format. Some other
207 possibilities for the host operating system (which is
208 actually a misnomer--host file system is more correct)
209 include OS/2 or NT with High Performance File System
210 (HPFS), MS-DOS, OS/2 or NT with File Allocation Table
211 (FAT) file system, and Macintosh. These are denoted as
212 follows:
213
214 -rw-a-- 1.0 hpf 5358 Tl i4:3 4-Dec-91 11:33 longfilename.hpfs
215 -r--ahs 1.1 fat 4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF
216 --w------- 1.0 mac 17357 bx i8:2 4-May-92 04:02 unzip.macr
217
218 File attributes in the first two cases are indicated in a
219 Unix-like format, where the seven subfields indicate
220 whether the file: (1) is a directory, (2) is readable
221 (always true), (3) is writable, (4) is executable (guessed
222 on the basis of the extension--.exe, .com, .bat, .cmd and
223 .btm files are assumed to be so), (5) has its archive bit
224 set, (6) is hidden, and (7) is a system file. Interpreta-
225 tion of Macintosh file attributes is unreliable because
226 some Macintosh archivers don't store any attributes in the
227 archive.
228
229 Finally, the sixth field indicates the compression method
230 and possible sub-method used. There are six methods known
231 at present: storing (no compression), reducing, shrink-
232 ing, imploding, tokenizing (never publicly released), and
233 deflating. In addition, there are four levels of reducing
234 (1 through 4); four types of imploding (4K or 8K sliding
235
236 Info-ZIP 28 February 2005 (v2.42) 4
237
238 ZIPINFO(1L) ZIPINFO(1L)
239
240 dictionary, and 2 or 3 Shannon-Fano trees); and four lev-
241 els of deflating (superfast, fast, normal, maximum com-
242 pression). zipinfo represents these methods and their
243 sub-methods as follows: stor; re:1, re:2, etc.; shrk;
244 i4:2, i8:3, etc.; tokn; and defS, defF, defN, and defX.
245
246 The medium and long listings are almost identical to the
247 short format except that they add information on the
248 file's compression. The medium format lists the file's
249 compression factor as a percentage indicating the amount
250 of space that has been ``removed'':
251
252 -rw-rws--- 1.5 unx 2802 t- 81% defX 11-Aug-91 13:48 perms.2660
253
254 In this example, the file has been compressed by more than
255 a factor of five; the compressed data are only 19% of the
256 original size. The long format gives the compressed
257 file's size in bytes, instead:
258
259 -rw-rws--- 1.5 unx 2802 t- 538 defX 11-Aug-91 13:48 perms.2660
260
261 In contrast to the unzip listings, the compressed size
262 figures in this listing format denote the complete size of
263 compressed data, including the 12 extra header bytes in
264 case of encrypted entries.
265
266 Adding the -T option changes the file date and time to
267 decimal format:
268
269 -rw-rws--- 1.5 unx 2802 t- 538 defX 910811.134804 perms.2660
270
271 Note that because of limitations in the MS-DOS format used
272 to store file times, the seconds field is always rounded
273 to the nearest even second. For Unix files this is
274 expected to change in the next major releases of zip(1L)
275 and unzip.
276
277 In addition to individual file information, a default zip-
278 file listing also includes header and trailer lines:
279
280 Archive: OS2.zip 5453 bytes 5 files
281 ,,rw, 1.0 hpf 730 b- i4:3 26-Jun-92 23:40 Contents
282 ,,rw, 1.0 hpf 3710 b- i4:3 26-Jun-92 23:33 makefile.os2
283 ,,rw, 1.0 hpf 8753 b- i8:3 26-Jun-92 15:29 os2unzip.c
284 ,,rw, 1.0 hpf 98 b- stor 21-Aug-91 15:34 unzip.def
285 ,,rw, 1.0 hpf 95 b- stor 21-Aug-91 17:51 zipinfo.def
286 5 files, 13386 bytes uncompressed, 4951 bytes compressed: 63.0%
287
288 The header line gives the name of the archive, its total
289 size, and the total number of files; the trailer gives the
290 number of files listed, their total uncompressed size, and
291 their total compressed size (not including any of zip's
292 internal overhead). If, however, one or more file(s) are
293 provided, the header and trailer lines are not listed.
294
295 Info-ZIP 28 February 2005 (v2.42) 5
296
297 ZIPINFO(1L) ZIPINFO(1L)
298
299 This behavior is also similar to that of Unix's ``ls -l'';
300 it may be overridden by specifying the -h and -t options
301 explicitly. In such a case the listing format must also
302 be specified explicitly, since -h or -t (or both) in the
303 absence of other options implies that ONLY the header or
304 trailer line (or both) is listed. See the EXAMPLES sec-
305 tion below for a semi-intelligible translation of this
306 nonsense.
307
308 The verbose listing is mostly self-explanatory. It also
309 lists file comments and the zipfile comment, if any, and
310 the type and number of bytes in any stored extra fields.
311 Currently known types of extra fields include PKWARE's
312 authentication (``AV'') info; OS/2 extended attributes;
313 VMS filesystem info, both PKWARE and Info-ZIP versions;
314 Macintosh resource forks; Acorn/Archimedes SparkFS info;
315 and so on. (Note that in the case of OS/2 extended
316 attributes--perhaps the most common use of zipfile extra
317 fields--the size of the stored EAs as reported by zipinfo
318 may not match the number given by OS/2's dir command: OS/2
319 always reports the number of bytes required in 16-bit for-
320 mat, whereas zipinfo always reports the 32-bit storage.)
321
322 Again, the compressed size figures of the individual
323 entries include the 12 extra header bytes for encrypted
324 entries. In contrast, the archive total compressed size
325 and the average compression ratio shown in the summary
326 bottom line are calculated without the extra 12 header
327 bytes of encrypted entries.
328
329 ENVIRONMENT OPTIONS
330 Modifying zipinfo's default behavior via options placed in
331 an environment variable can be a bit complicated to
332 explain, due to zipinfo's attempts to handle various
333 defaults in an intuitive, yet Unix-like, manner. (Try not
334 to laugh.) Nevertheless, there is some underlying logic.
335 In brief, there are three ``priority levels'' of options:
336 the default options; environment options, which can over-
337 ride or add to the defaults; and explicit options given by
338 the user, which can override or add to either of the
339 above.
340
341 The default listing format, as noted above, corresponds
342 roughly to the "zipinfo -hst" command (except when indi-
343 vidual zipfile members are specified). A user who prefers
344 the long-listing format (-l) can make use of the zipinfo's
345 environment variable to change this default:
346
347 Unix Bourne shell:
348 ZIPINFO=-l; export ZIPINFO
349
350 Unix C shell:
351 setenv ZIPINFO -l
352
353 Info-ZIP 28 February 2005 (v2.42) 6
354
355 ZIPINFO(1L) ZIPINFO(1L)
356
357 OS/2 or MS-DOS:
358 set ZIPINFO=-l
359
360 VMS (quotes for lowercase):
361 define ZIPINFO_OPTS "-l"
362
363 If, in addition, the user dislikes the trailer line, zip-
364 info's concept of ``negative options'' may be used to
365 override the default inclusion of the line. This is
366 accomplished by preceding the undesired option with one or
367 more minuses: e.g., ``-l-t'' or ``--tl'', in this exam-
368 ple. The first hyphen is the regular switch character,
369 but the one before the `t' is a minus sign. The dual use
370 of hyphens may seem a little awkward, but it's reasonably
371 intuitive nonetheless: simply ignore the first hyphen and
372 go from there. It is also consistent with the behavior of
373 the Unix command nice(1).
374
375 As suggested above, the default variable names are ZIP-
376 INFO_OPTS for VMS (where the symbol used to install zip-
377 info as a foreign command would otherwise be confused with
378 the environment variable), and ZIPINFO for all other oper-
379 ating systems. For compatibility with zip(1L), ZIPINFOOPT
380 is also accepted (don't ask). If both ZIPINFO and ZIPIN-
381 FOOPT are defined, however, ZIPINFO takes precedence.
382 unzip's diagnostic option (-v with no zipfile name) can be
383 used to check the values of all four possible unzip and
384 zipinfo environment variables.
385
386 EXAMPLES
387 To get a basic, short-format listing of the complete con-
388 tents of a ZIP archive storage.zip, with both header and
389 totals lines, use only the archive name as an argument to
390 zipinfo:
391
392 zipinfo storage
393
394 To produce a basic, long-format listing (not verbose),
395 including header and totals lines, use -l:
396
397 zipinfo -l storage
398
399 To list the complete contents of the archive without
400 header and totals lines, either negate the -h and -t
401 options or else specify the contents explicitly:
402
403 zipinfo --h-t storage
404 zipinfo storage \*
405
406 (where the backslash is required only if the shell would
407 otherwise expand the `*' wildcard, as in Unix when glob-
408 bing is turned on--double quotes around the asterisk would
409 have worked as well). To turn off the totals line by
410 default, use the environment variable (C shell is assumed
411
412 Info-ZIP 28 February 2005 (v2.42) 7
413
414 ZIPINFO(1L) ZIPINFO(1L)
415
416 here):
417
418 setenv ZIPINFO --t
419 zipinfo storage
420
421 To get the full, short-format listing of the first example
422 again, given that the environment variable is set as in
423 the previous example, it is necessary to specify the -s
424 option explicitly, since the -t option by itself implies
425 that ONLY the footer line is to be printed:
426
427 setenv ZIPINFO --t
428 zipinfo -t storage [only totals line]
429 zipinfo -st storage [full listing]
430
431 The -s option, like -m and -l, includes headers and foot-
432 ers by default, unless otherwise specified. Since the
433 environment variable specified no footers and that has a
434 higher precedence than the default behavior of -s, an
435 explicit -t option was necessary to produce the full list-
436 ing. Nothing was indicated about the header, however, so
437 the -s option was sufficient. Note that both the -h and
438 -t options, when used by themselves or with each other,
439 override any default listing of member files; only the
440 header and/or footer are printed. This behavior is useful
441 when zipinfo is used with a wildcard zipfile specifica-
442 tion; the contents of all zipfiles are then summarized
443 with a single command.
444
445 To list information on a single file within the archive,
446 in medium format, specify the filename explicitly:
447
448 zipinfo -m storage unshrink.c
449
450 The specification of any member file, as in this example,
451 will override the default header and totals lines; only
452 the single line of information about the requested file
453 will be printed. This is intuitively what one would
454 expect when requesting information about a single file.
455 For multiple files, it is often useful to know the total
456 compressed and uncompressed size; in such cases -t may be
457 specified explicitly:
458
459 zipinfo -mt storage "*.[ch]" Mak\*
460
461 To get maximal information about the ZIP archive, use the
462 verbose option. It is usually wise to pipe the output
463 into a filter such as Unix more(1) if the operating system
464 allows it:
465
466 zipinfo -v storage | more
467
468 Finally, to see the most recently modified files in the
469 archive, use the -T option in conjunction with an external
470
471 Info-ZIP 28 February 2005 (v2.42) 8
472
473 ZIPINFO(1L) ZIPINFO(1L)
474
475 sorting utility such as Unix sort(1) (and sed(1) as well,
476 in this example):
477
478 zipinfo -T storage | sort -nr -k 7 | sed 15q
479
480 The -nr option to sort(1) tells it to sort numerically in
481 reverse order rather than in textual order, and the -k 7
482 option tells it to sort on the seventh field. This
483 assumes the default short-listing format; if -m or -l is
484 used, the proper sort(1) option would be -k 8. Older ver-
485 sions of sort(1) do not support the -k option, but you can
486 use the traditional + option instead, e.g., +6 instead of
487 -k 7. The sed(1) command filters out all but the first 15
488 lines of the listing. Future releases of zipinfo may
489 incorporate date/time and filename sorting as built-in
490 options.
491
492 TIPS
493 The author finds it convenient to define an alias ii for
494 zipinfo on systems that allow aliases (or, on other sys-
495 tems, copy/rename the executable, create a link or create
496 a command file with the name ii). The ii usage parallels
497 the common ll alias for long listings in Unix, and the
498 similarity between the outputs of the two commands was
499 intentional.
500
501 BUGS
502 As with unzip, zipinfo's -M (``more'') option is overly
503 simplistic in its handling of screen output; as noted
504 above, it fails to detect the wrapping of long lines and
505 may thereby cause lines at the top of the screen to be
506 scrolled off before being read. zipinfo should detect and
507 treat each occurrence of line-wrap as one additional line
508 printed. This requires knowledge of the screen's width as
509 well as its height. In addition, zipinfo should detect
510 the true screen geometry on all systems.
511
512 zipinfo's listing-format behavior is unnecessarily complex
513 and should be simplified. (This is not to say that it
514 will be.)
515
516 SEE ALSO
517 ls(1), funzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zip-
518 cloak(1L), zipnote(1L), zipsplit(1L)
519
520 URL
521 The Info-ZIP home page is currently at
522 http://www.info-zip.org/pub/infozip/
523 or
524 ftp://ftp.info-zip.org/pub/infozip/ .
525
526 AUTHOR
527 Greg ``Cave Newt'' Roelofs. ZipInfo contains pattern-
528
529 Info-ZIP 28 February 2005 (v2.42) 9
530
531 ZIPINFO(1L) ZIPINFO(1L)
532
533 matching code by Mark Adler and fixes/improvements by many
534 others. Please refer to the CONTRIBS file in the UnZip
535 source distribution for a more complete list.
536
537 Info-ZIP 28 February 2005 (v2.42) 10
538