zipinfo.1
资源名称:unzip540.zip [点击查看]
上传用户:andy_li
上传日期:2007-01-06
资源大小:1019k
文件大小:21k
源码类别:
压缩解压
开发平台:
MultiPlatform
- ." Info-ZIP grants permission to any individual or institution to use, copy,
- ." or redistribute this software, so long as: (1) all of the original files
- ." are included; (2) it is not sold for profit; and (3) this notice is re-
- ." tained. See the UnZip COPYING file for details.
- ."
- ." zipinfo.1 by Greg Roelofs and others.
- ."
- ." =========================================================================
- ." define .X macro (for long-line ZipInfo output examples; small Courier):
- .de X
- .ft CW
- .nf
- .ie n .ti -5
- .el { .ti +2m
- .ps -1 }
- &\$1
- .ie n .ti +5
- .el { .ti -2m
- .ps +1 }
- .ft
- .fi
- ..
- ." define .Y macro (for user-command examples; normal Courier font):
- .de Y
- .ft CW
- .in +4n
- .nf
- &\$1
- .ft
- .in
- .fi
- ..
- ." =========================================================================
- .TH ZIPINFO 1L "28 November 1998 (v2.3)" "Info-ZIP"
- .SH NAME
- zipinfo - list detailed information about a ZIP archive
- .PD
- .SH SYNOPSIS
- fBzipinfofP [fB-12smlvhMtTzfP] fIfilefP[fI.zipfP]
- [fIfile(s)fP .|.|.] [fB-xfP fIxfile(s)fP .|.|.]
- .PP
- fBunzipfP fB-ZfP [fB-12smlvhMtTzfP] fIfilefP[fI.zipfP]
- [fIfile(s)fP .|.|.] [fB-xfP fIxfile(s)fP .|.|.]
- .PD
- ." =========================================================================
- .SH DESCRIPTION
- fIzipinfofP lists technical information about files in a ZIP archive, most
- commonly found on MS-DOS systems. Such information includes file access
- permissions, encryption status, type of compression, version and operating
- system or file system of compressing program, and the like. The default
- behavior (with no options) is
- to list single-line entries for each file in the archive, with header and
- trailer lines providing summary information for the entire archive. The
- format is a cross between Unix ``fCls -lfR'' and ``fCunzip -vfR''
- output. See
- .B "DETAILED DESCRIPTION"
- below. Note that fIzipinfofP is the same program as fIunzipfP (under
- Unix, a link to it); on some systems, however, fIzipinfofP support may
- have been omitted when fIunzipfP was compiled.
- .PD
- ." =========================================================================
- .SH ARGUMENTS
- .TP
- .IR file [ .zip ]
- Path of the ZIP archive(s). If the file specification is a wildcard,
- each matching file is processed in an order determined by the operating
- system (or file system). Only the filename can be a wildcard; the path
- itself cannot. Wildcard expressions are similar to Unix fIegrepfP(1)
- (regular) expressions and may contain:
- .RS
- .IP *
- matches a sequence of 0 or more characters
- .IP ?
- matches exactly 1 character
- .IP [.|.|.]
- matches any single character found inside the brackets; ranges are specified
- by a beginning character, a hyphen, and an ending character. If an exclamation
- point or a caret (`!' or `^') follows the left bracket, then the range of
- characters within the brackets is complemented (that is, anything fIexceptfP
- the characters inside the brackets is considered a match).
- .RE
- .IP
- (Be sure to quote any character that might otherwise be interpreted or
- modified by the operating system, particularly under Unix and VMS.) If no
- matches are found, the specification is assumed to be a literal filename;
- and if that also fails, the suffix fC.zipfR is appended. Note that
- self-extracting ZIP files are supported; just specify the fC.exefR suffix
- (if any) explicitly.
- .IP [fIfile(s)fP]
- An optional list of archive members to be processed.
- Regular expressions (wildcards) may be used to match multiple members; see
- above. Again, be sure to quote expressions that would otherwise be expanded
- or modified by the operating system.
- .IP [fB-xfP fIxfile(s)fP]
- An optional list of archive members to be excluded from processing.
- ." =========================================================================
- .SH OPTIONS
- .TP
- .B -1
- list filenames only, one per line. This option excludes all others; headers,
- trailers and zipfile comments are never printed. It is intended for use in
- Unix shell scripts.
- .TP
- .B -2
- list filenames only, one per line, but allow headers (fB-hfP), trailers
- (fB-tfP) and zipfile comments (fB-zfP), as well. This option may be
- useful in cases where the stored filenames are particularly long.
- .TP
- .B -s
- list zipfile info in short Unix ``fCls -lfR'' format. This is the default
- behavior; see below.
- .TP
- .B -m
- list zipfile info in medium Unix ``fCls -lfR'' format. Identical to the
- fB-sfP output, except that the compression factor, expressed as a
- percentage, is also listed.
- .TP
- .B -l
- list zipfile info in long Unix ``fCls -lfR'' format. As with fB-mfP
- except that the compressed size (in bytes) is printed instead of the
- compression ratio.
- .TP
- .B -v
- list zipfile information in verbose, multi-page format.
- .TP
- .B -h
- list header line. The archive name, actual size (in bytes) and total number
- of files is printed.
- .TP
- .B -M
- pipe all output through an internal pager similar to the Unix fImorefP(1)
- command. At the end of a screenful of output, fIzipinfofP pauses with a
- ``--More--'' prompt; the next screenful may be viewed by pressing the
- Enter (Return) key or the space bar. fIzipinfofP can be terminated by
- pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike
- Unix fImorefP(1), there is no forward-searching or editing capability.
- Also, fIzipinfofP doesn't notice if long lines wrap at the edge of the
- screen, effectively resulting in the printing of two or more lines and the
- likelihood that some text will scroll off the top of the screen before being
- viewed. On some systems the number of available lines on the screen is not
- detected, in which case fIzipinfofP assumes the height is 24 lines.
- .TP
- .B -t
- list totals for files listed or for all files. The number of files listed,
- their uncompressed and compressed total sizes, and their overall compression
- factor is printed; or, if only the totals line is being printed, the values
- for the entire archive are given. Note that the total compressed (data)
- size will never match the actual zipfile size, since the latter includes all
- of the internal zipfile headers in addition to the compressed data.
- .TP
- .B -T
- print the file dates and times in a sortable decimal format (yymmdd.hhmmss).
- The default date format is a more standard, human-readable version with
- abbreviated month names (see examples below).
- .TP
- .B -z
- include the archive comment (if any) in the listing.
- .PD
- ." =========================================================================
- .SH "DETAILED DESCRIPTION"
- .I zipinfo
- has a number of modes, and its behavior can be rather difficult to fathom
- if one isn't familiar with Unix fIlsfP(1) (or even if one is). The default
- behavior is to list files in the following format:
- .PP
- .X "-rw-rws--- 1.9 unx 2802 t- defX 11-Aug-91 13:48 perms.2660"
- .PP
- The last three fields are the modification date and time of
- the file, and its name. The case of the filename is respected; thus
- files that come from MS-DOS PKZIP are always capitalized. If the file
- was zipped with a stored directory name, that is also displayed as part
- of the filename.
- .PP
- The second and third fields indicate that the file was zipped under
- Unix with version 1.9 of fIzipfP. Since it comes from Unix, the file
- permissions at the beginning of the line are printed in Unix format.
- The uncompressed file-size (2802 in this example) is the fourth field.
- .PP
- The fifth field consists of two characters, either of which may take
- on several values. The first character may be either `t' or `b', indicating
- that fIzipfP believes the file to be text or binary, respectively;
- but if the file is encrypted, fIzipinfofP
- notes this fact by capitalizing the character (`T' or `B'). The second
- character may also take on four values, depending on whether there is
- an extended local header and/or an ``extra field'' associated with the
- file (fully explained in PKWare's APPNOTE.TXT, but basically analogous to
- pragmas in ANSI C--i.e., they provide a standard way to include non-standard
- information in the archive). If neither exists, the character
- will be a hyphen (`-'); if there is an extended local header but no extra
- field, `l'; if the reverse, `x'; and if both exist, `X'. Thus the
- file in this example is (probably) a text file, is not encrypted, and
- has neither an extra field nor an extended local header associated with it.
- The example below, on the other hand, is an encrypted binary file with an
- extra field:
- .PP
- .X "RWD,R,R 0.9 vms 168 Bx shrk 9-Aug-91 19:15 perms.0644"
- .PP
- Extra fields are used for various purposes (see discussion of the fB-vfP
- option below) including the storage of VMS file attributes, which is
- presumably the case here. Note that the file attributes are listed in
- VMS format. Some other possibilities for the host operating system (which
- is actually a misnomer--host file system is more correct) include
- OS/2 or NT with High Performance File System (HPFS), MS-DOS, OS/2 or NT
- with File Allocation Table (FAT) file system, and Macintosh. These are
- denoted as follows:
- .PP
- .X "-rw-a-- 1.0 hpf 5358 Tl i4:3 4-Dec-91 11:33 longfilename.hpfs"
- .X "-r--ahs 1.1 fat 4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF"
- .X "--w------- 1.0 mac 17357 bx i8:2 4-May-92 04:02 unzip.macr"
- .PP
- File attributes in the first two cases are indicated in a Unix-like format,
- where the seven subfields indicate whether the file: (1) is a directory,
- (2) is readable (always true), (3) is writable, (4) is executable (guessed
- on the basis of the extension--fI.exefP, fI.comfP, fI.batfP, fI.cmdfP
- and fI.btmfP files are assumed to be so), (5) has its archive bit set,
- (6) is hidden, and (7) is a system file. Interpretation of Macintosh file
- attributes is unreliable because some Macintosh archivers don't store any
- attributes in the archive.
- .PP
- Finally, the sixth field indicates
- the compression method and possible sub-method used. There are six methods
- known at present: storing (no compression), reducing, shrinking, imploding,
- tokenizing (never publicly released), and deflating. In addition, there are
- four levels of reducing (1 through 4); four types of imploding (4K or 8K
- sliding dictionary, and 2 or 3 Shannon-Fano trees); and four levels of
- deflating (superfast, fast, normal, maximum compression). fIzipinfofP
- represents these methods and their sub-methods as follows: fIstorfP;
- fIre:1fP, fIre:2fP, etc.; fIshrkfP; fIi4:2fP, fIi8:3fP, etc.;
- fItoknfP; and fIdefSfP, fIdefFfP, fIdefNfP, and fIdefXfP.
- .PP
- The medium and long listings are almost identical to the short format except
- that they add information on the file's compression. The medium format lists
- the file's compression factor as a percentage indicating the amount of space
- that has been ``removed'':
- .PP
- .X "-rw-rws--- 1.5 unx 2802 t- 81% defX 11-Aug-91 13:48 perms.2660"
- .PP
- In this example, the file has been compressed by more than a factor of
- five; the compressed data are only 19% of the original size. The long
- format gives the compressed file's size in bytes, instead:
- .PP
- .X "-rw-rws--- 1.5 unx 2802 t- 538 defX 11-Aug-91 13:48 perms.2660"
- .PP
- Adding the fB-TfP option changes the file date and time to decimal
- format:
- .PP
- .X "-rw-rws--- 1.5 unx 2802 t- 538 defX 910811.134804 perms.2660"
- .PP
- Note that because of limitations in the MS-DOS format used to store file
- times, the seconds field is always rounded to the nearest even second.
- For Unix files this is expected to change in the next major releases of
- fIzipfP(1L) and fIunzipfP.
- .PP
- In addition to individual file information, a default zipfile listing
- also includes header and trailer lines:
- .PP
- .X "Archive: OS2.zip 5453 bytes 5 files"
- .X ",,rw, 1.0 hpf 730 b- i4:3 26-Jun-92 23:40 Contents"
- .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 fIzipfP'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 -lfR'';
- it may be overridden by specifying the fB-hfP and fB-tfP options
- explicitly.
- In such a case the listing format must also be specified explicitly,
- since fB-hfP or fB-tfP (or both) in the absence of other options implies
- that ONLY the header or trailer line (or both) is listed. See the
- fBEXAMPLESfP 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
- fIzipinfofP may not match the number given by OS/2's fIdirfP command:
- OS/2 always reports the number of bytes required in 16-bit format, whereas
- fIzipinfofP always reports the 32-bit storage.)
- .PD
- ." =========================================================================
- .SH "ENVIRONMENT OPTIONS"
- Modifying fIzipinfofP's default behavior via options placed in
- an environment variable can be a bit complicated to explain, due to
- fIzipinfofP'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 -hstfR" command (except when individual zipfile members
- are specified).
- A user who prefers the long-listing format (fB-lfP) can make use of the
- fIzipinfofP's environment variable to change this default:
- .PP
- .DT
- .ft CW
- .in +4n
- .ta w'ZIPINFO=-l; export ZIPINFO'u+4n
- .in
- .ft
- .PD 0
- .Y "ZIPINFO=-l; export ZIPINFOtfRUnix Bourne shell"
- .Y "setenv ZIPINFO -ltfRUnix C shell"
- .Y "set ZIPINFO=-ltfROS/2 or MS-DOS"
- .Y "define ZIPINFO_OPTS ""-l""tfRVMS (quotes for fIlowercasefP)"
- .PD
- .PP
- If, in addition, the user dislikes the trailer line, fIzipinfofP'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-tfR'' or ``fC--tlfR'',
- 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 fInicefP(1).
- .PP
- As suggested above, the default variable names are ZIPINFO_OPTS for VMS
- (where the symbol used to install fIzipinfofP as a foreign command
- would otherwise be confused with the environment variable), and ZIPINFO
- for all other operating systems. For compatibility with fIzipfP(1L),
- ZIPINFOOPT is also accepted (don't ask). If both ZIPINFO and ZIPINFOOPT
- are defined, however, ZIPINFO takes precedence. fIunzipfP's diagnostic
- option (fB-vfP with no zipfile name) can be used to check the values
- of all four possible fIunzipfP and fIzipinfofP environment variables.
- .PD
- ." =========================================================================
- .SH EXAMPLES
- To get a basic, short-format listing of the complete contents of a ZIP
- archive fIstorage.zipfP, with both header and totals lines, use only
- the archive name as an argument to zipinfo:
- .PP
- .Y "zipinfo storage"
- .PP
- To produce a basic, long-format listing (not verbose), including header and
- totals lines, use fB-lfP:
- .PP
- .Y "zipinfo -l storage"
- .PP
- To list the complete contents of the archive without header and totals
- lines, either negate the fB-hfP and fB-tfP options or else specify the
- contents explicitly:
- .PP
- .PD 0
- .Y "zipinfo --h-t storage"
- .Y "zipinfo storage e*"
- .PD
- .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
- .PD 0
- .Y "setenv ZIPINFO --t"
- .Y "zipinfo storage"
- .PD
- .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-sfP option explicitly, since the fB-tfP
- option by itself implies that ONLY the footer line is to be printed:
- .PP
- .PD 0
- .Y "setenv ZIPINFO --t"
- .Y "zipinfo -t storagetfR[only totals line]"
- .Y "zipinfo -st storagetfR[full listing]"
- .PD
- .PP
- The fB-sfP option, like fB-mfP and fB-lfP, 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-sfP, an explicit fB-tfP option was necessary
- to produce the full listing. Nothing was indicated about the header,
- however, so the fB-sfP option was sufficient. Note that both the
- fB-hfP and fB-tfP 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 fIzipinfofP 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
- .Y "zipinfo -m storage unshrink.c"
- .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-tfP may be specified explicitly:
- .PP
- .Y "zipinfo -mt storage ""*.[ch]"" Make*"
- .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 fImorefP(1) if the operating system allows it:
- .PP
- .Y "zipinfo -v storage | more"
- .PP
- Finally, to see the most recently modified files in the archive, use
- the fB-TfP option in conjunction with an external sorting utility
- such as Unix fIsortfP(1) (and fItailfP(1) as well, in this example):
- .PP
- .Y "zipinfo -T storage | sort -n +6 | tail -15"
- .PP
- The fB-nfP option to fIsortfP(1) tells it to sort numerically
- rather than in ASCII order, and the fB+6fP option tells it to sort
- on the sixth field after the first one (i.e., the seventh field). This
- assumes the default short-listing format; if fB-mfP or fB-lfP is
- used, the proper fIsortfP(1) option would be fB+7fP. The fItailfP(1)
- command filters out all but the last 15 lines of the listing. Future
- releases of fIzipinfofP may incorporate date/time and filename sorting
- as built-in options.
- .PD
- ." =========================================================================
- .SH TIPS
- The author finds it convenient to define an alias fIiifP for fIzipinfofP
- on systems that allow aliases (or, on other systems, copy/rename the
- executable, create a link or create a command file with the name fIiifP).
- The fIiifP usage parallels the common fIllfP alias for long listings in
- Unix, and the similarity between the outputs of the two commands was
- intentional.
- .PD
- ." =========================================================================
- .SH BUGS
- As with fIunzipfP, fIzipinfofP's fB-MfP (``more'') option is overly
- simplistic in its handling of screen output; as noted above, it fails to detect
- the wrapping of long lines and may thereby cause lines at the top of the screen
- to be scrolled off before being read. fIzipinfofP should detect and treat
- each occurrence of line-wrap as one additional line printed. This requires
- knowledge of the screen's width as well as its height. In addition,
- fIzipinfofP should detect the true screen geometry on all systems.
- .PP
- fIzipinfofP's listing-format behavior is unnecessarily complex and should
- be simplified. (This is not to say that it will be.)
- .PP
- ." =========================================================================
- .SH "SEE ALSO"
- fIlsfP(1), fIfunzipfP(1L), fIunzipfP(1L), fIunzipsfxfP(1L),
- fIzipfP(1L), fIzipcloakfP(1L), fIzipnotefP(1L), fIzipsplitfP(1L)
- .PD
- ." =========================================================================
- .SH URL
- The Info-ZIP home page is currently at fChttp://www.cdrom.com/pub/infozip/fR .
- .PD
- ." =========================================================================
- .SH AUTHOR
- Greg ``Cave Newt'' Roelofs. ZipInfo contains pattern-matching code
- by Mark Adler and fixes/improvements by many others. Please refer to the
- CONTRIBS file in the UnZip source distribution for a more complete list.