home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unz532.zip / ZIPINFO.DOC < prev   
Text File  |  1997-11-02  |  24KB  |  505 lines

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