home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / UNZP50P1.ZIP / zipinfo.doc < prev    next >
Text File  |  1993-01-23  |  15KB  |  334 lines

  1.  
  2. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  3.  
  4. NAME
  5.      zipinfo - list detailed information about a ZIP archive file
  6.  
  7. SYNOPSIS
  8.      zipinfo [-1smlvht] file[.zip] [filespec ...]
  9.  
  10. ARGUMENTS
  11.      file[.zip]  Path of the ZIP archive.  The suffix ``.zip'' is
  12.                  applied  if  the  file specified does not exist.
  13.                  Note that self-extracting  ZIP  files  are  sup-
  14.                  ported;  just  specify the ``.exe'' suffix your-
  15.                  self.
  16.  
  17.      [filespec]  An optional list of archive members to  be  pro-
  18.                  cessed.  Expressions may be used to match multi-
  19.                  ple members; be sure to quote  expressions  that
  20.                  contain   characters  interpreted  by  the  Unix
  21.                  shell. See PATTERN  MATCHING  (below)  for  more
  22.                  details.
  23.  
  24. OPTIONS
  25.      -1  list filenames only, one per line (useful for pipes)
  26.      -s  list zipfile  info  in  short  Unix  ``ls  -l''  format:
  27.          default
  28.      -m  list zipfile info in medium Unix ``ls -l'' format
  29.      -l  list zipfile info in long Unix ``ls -l'' format
  30.      -v  list zipfile information in verbose, multi-page format
  31.      -h  list header line
  32.      -t  list totals for files listed or for all files
  33.  
  34. PATTERN MATCHING
  35.      All archive members are listed unless a filespec is provided
  36.      to specify a subset of the archive members.  The filespec is
  37.      similar to an egrep expression, and may contain:
  38.  
  39.      *      matches a sequence of 0 or more characters
  40.      ?      matches exactly 1 character
  41.      \nnn   matches the character having octal code nnn
  42.      [...]  matches any single character found inside the  brack-
  43.             ets; ranges are specified by a beginning character, a
  44.             hyphen, and an ending character.  If  an  exclamation
  45.             point  or  a  carat  (`!'  or  `^')  follows the left
  46.             bracket, then the range of characters matched is com-
  47.             plemented  with  respect  to  the ASCII character set
  48.             (that is, anything except the characters  inside  the
  49.             brackets is considered a match).
  50.  
  51. DESCRIPTION
  52.      ZipInfo lists technical information  about  a  ZIP  archive,
  53.      including  information  file  access permissions, encryption
  54.      status, type of compression, version and operating system of
  55.      compressing program, and the like.  The default option is to
  56.  
  57. Info-ZIP          Last change: 19 Aug 92 (v1.0)                 1
  58.  
  59. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  60.  
  61.      list files in the following format:
  62.  
  63. -rw-rwl---  1.5 unx    2802 t- defX 11-Aug-91 13:48 perms.2660
  64.  
  65.      The last three fields are clearly the modification date  and
  66.      time of the file, and its name.  The case of the filename is
  67.      respected; thus files  which  come  from  MS-DOS  PKZIP  are
  68.      always  capitalized.   If  the file was zipped with a stored
  69.      directory name, that  is  also  displayed  as  part  of  the
  70.      filename.
  71.  
  72.      The second and third  fields  indicate  that  the  file  was
  73.      zipped  under Unix with version 1.5 of Zip (a beta version).
  74.      Since it comes from Unix, the file permissions at the begin-
  75.      ning   of   the  line  are  printed  in  Unix  format.   The
  76.      uncompressed file-size (2802 in this example) is the  fourth
  77.      field.
  78.  
  79.      The fifth field consists of two characters, either of  which
  80.      may  take  on  several  values.   The first character may be
  81.      either `t' or `b', indicating that Zip believes the file  to
  82.      be  text  or  binary,  respectively;  but  if  the  file  is
  83.      encrypted, ZipInfo notes this fact by capitalizing the char-
  84.      acter  (`T'  or `B').  The second character may also take on
  85.      four values, depending on whether there is an extended local
  86.      header  and/or  an  ``extra field'' associated with the file
  87.      (explained in PKWare's APPNOTE.TXT).  If neither exists, the
  88.      character  will  be  a hyphen (`-'); if there is an extended
  89.      local header but no extra field, `l'; if the  reverse,  `x';
  90.      and  if  both  exist, `X'.  Thus the file in this example is
  91.      (apparently) a text file, is not encrypted, and has  neither
  92.      an  extra field nor an extended local header associated with
  93.      it.  The example below, on the other hand, is  an  encrypted
  94.      binary file with an extra field:
  95.  
  96. RWD,R,R     0.9 vms     168 Bx shrk  9-Aug-91 19:15 perms.0644
  97.  
  98.      Extra fields are used by PKWare for  authenticity  verifica-
  99.      tion(?)  and  possibly other purposes, and by Info-ZIP's Zip
  100.      1.6 and later to store OS/2, Macintosh and VMS  file  attri-
  101.      butes.  This example presumably falls into the latter class,
  102.      then.  Note that the file attributes are listed in VMS  for-
  103.      mat.   Other  possibilities  for  the  host operating system
  104.      include OS/2 with High Performance File System  (HPFS),  DOS
  105.      or  OS/2  with  File Allocation Table (FAT) file system, and
  106.      Macintosh, denoted as follows:
  107.  
  108. arc,,rw,    1.0 os2    5358 Tl i4:3  4-Dec-91 11:33 longfilename.hpfs
  109. arc,hid,rdo,sys dos    4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF
  110. --w-------  1.0 mac   17357 bx i8:2  4-May-92 04:02 unzip.macr
  111.  
  112. Info-ZIP          Last change: 19 Aug 92 (v1.0)                 2
  113.  
  114. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  115.  
  116.      File attributes in the first two cases are  indicated  in  a
  117.      DOS-like  format,  where  the  file  may or may not have its
  118.      archive bit set; may be hidden or not; may be read-write  or
  119.      read-only;  and  may be a system file or not.  If the attri-
  120.      butes are too long,  the  version  number  of  the  encoding
  121.      software is omitted.  (The information is still available in
  122.      the verbose listing, however.)  Interpretation of  Macintosh
  123.      file attributes needs some work yet.
  124.  
  125.      Finally, the sixth field indicates  the  compression  method
  126.      and  possible  sub-method used.  There are six methods known
  127.      at present:  storing (no compression), reducing,  shrinking,
  128.      imploding,  tokenizing,  and  deflating.  In addition, there
  129.      are four levels of reducing (1 through  4);  four  types  of
  130.      imploding  (4K or 8K sliding dictionary, and 2 or 3 Shannon-
  131.      Fano trees); and three levels of  deflating  (fast,  normal,
  132.      maximum  compression).  ZipInfo represents these methods and
  133.      their sub-methods as follows:  ``stor''; ``re:1,'' ``re:2,''
  134.      etc.;  ``shrk'';  ``i4:2,''  ``i8:3,''  etc.;  ``tokn''; and
  135.      ``defF,'' ``defN,'' and ``defX.''
  136.  
  137.      The medium and long listings are  almost  identical  to  the
  138.      short  format except that they add information on the file's
  139.      compression.   The  medium  format  indicates   the   file's
  140.      compression factor as a percentage:
  141.  
  142. -rw-rwl---  1.5 unx    2802 t- 81% defX 11-Aug-91 13:48 perms.2660
  143.  
  144.      In this example, the file has been compressed by more than a
  145.      factor of five; the compressed data are only 19% of the ori-
  146.      ginal size.  The long format  gives  the  compressed  file's
  147.      size in bytes, instead:
  148.  
  149. -rw-rwl---  1.5 unx    2802 t-     538 defX 11-Aug-91 13:48 perms.2660
  150.  
  151.      In addition to individual file information, a  default  zip-
  152.      file listing also includes header and trailer lines:
  153.  
  154. Archive:  OS2.zip   5453 bytes   5 files
  155. ,,rw,       1.0 os2     730 b- i4:3 26-Jun-92 23:40 Contents
  156. ,,rw,       1.0 os2    3710 b- i4:3 26-Jun-92 23:33 makefile.os2
  157. ,,rw,       1.0 os2    8753 b- i8:3 26-Jun-92 15:29 os2unzip.c
  158. ,,rw,       1.0 os2      98 b- stor 21-Aug-91 15:34 unzip.def
  159. ,,rw,       1.0 os2      95 b- stor 21-Aug-91 17:51 zipinfo.def
  160. 5 files, 13386 bytes uncompressed, 4951 bytes compressed:  63%
  161.  
  162.      The header line gives the name of  the  archive,  its  total
  163.      size,  and  the total number of files; the trailer gives the
  164.      number of files listed, their total uncompressed  size,  and
  165.      their  total  compressed  size  (not  including any of Zip's
  166.      internal overhead).  If, however, one or more filespecs  are
  167.      provided, the header and trailer lines are not listed.  This
  168.  
  169. Info-ZIP          Last change: 19 Aug 92 (v1.0)                 3
  170.  
  171. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  172.  
  173.      behavior is also similar to that of Unix's ``ls -l''; it may
  174.      be  overridden  by  specifying  the -h and -t options expli-
  175.      citly.  In such a case  the  listing  format  must  also  be
  176.      specified  explicitly,  since  -h  or  -t  (or  both) in the
  177.      absence of other options implies that  ONLY  the  header  or
  178.      trailer  line (or both) is listed.  See the EXAMPLES section
  179.      below for a semi-intelligible translation of this nonsense.
  180.  
  181.      The verbose listing is self-explanatory.  It also lists file
  182.      comments  and the zipfile comment, if any, and the number of
  183.      bytes of OS/2 extended attributes  stored.   Note  that  the
  184.      latter  number will in general NOT match the number given by
  185.      OS/2's ``dir'' command; OS/2 always reports  the  number  of
  186.      bytes  required  in  16-bit  format,  whereas ZipInfo always
  187.      reports the 32-bit storage.
  188.  
  189. ENVIRONMENT OPTIONS
  190.      Modifying ZipInfo's default behavior via options  placed  in
  191.      an environment variable can be a bit complicated to explain,
  192.      due to ZipInfo's attempts to handle various defaults  in  an
  193.      intuitive,  yet  Unix-like,  manner.  Nevertheless, there is
  194.      some underlying logic.  In brief, there are three ``priority
  195.      levels''  of  options:   the  default  options;  environment
  196.      options, which can override or  add  to  the  defaults;  and
  197.      explicit  options  given  by the user, which can override or
  198.      add to either of the above.
  199.  
  200.      The default listing  format,  as  noted  above,  corresponds
  201.      roughly  to  the "zipinfo -hst" command (except when indivi-
  202.      dual zipfile members are specified).  A user who prefers the
  203.      long-listing  format  (-l)  can  make  use  of  the  ZIPINFO
  204.      environment variable to change this default:
  205.  
  206.            setenv ZIPINFO -l            Unix C shell
  207.  
  208.            ZIPINFO=-l; export ZIPINFO   Unix Bourne shell
  209.  
  210.            set ZIPINFO=-l               OS/2 or MS-DOS
  211.  
  212.            define ZIPINFO_OPTS "-l"     VMS (quotes for LOWERCASE)
  213.  
  214.      If,  in  addition,  the  user  dislikes  the  trailer  line,
  215.      ZipInfo's concept of ``negative options''  may  be  used  to
  216.      override  the default inclusion of the line.  This is accom-
  217.      plished by preceding the undesired option with one  or  more
  218.      minuses:   e.g., ``-l-t'' or ``--tl'', in this example.  The
  219.      first hyphen is the regular switch character,  but  the  one
  220.      before the `t' is a minus sign.  The dual use of hyphens may
  221.      seem  a  little  awkward,  but  it's  reasonably   intuitive
  222.      nonetheless:   simply  ignore  the  first hyphen and go from
  223.      there.  It is also consistent with the behavior of the  Unix
  224.      command nice(1).
  225.  
  226. Info-ZIP          Last change: 19 Aug 92 (v1.0)                 4
  227.  
  228. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  229.  
  230. EXAMPLES
  231.      To get a basic, short-format listing of  the  complete  con-
  232.      tents of a ZIP archive ``storage.zip,'' with both header and
  233.      totals lines, use only the archive name as  an  argument  to
  234.      zipinfo:
  235.  
  236.            zipinfo storage
  237.  
  238.      To produce  a  basic,  long-format  listing  (not  verbose),
  239.      including header and totals lines, use -l:
  240.  
  241.            zipinfo -l storage
  242.  
  243.      To list the complete contents of the archive without  header
  244.      and  totals  lines,  either  negate the -h and -t options or
  245.      else specify the contents explicitly:
  246.  
  247.            zipinfo --h-t storage
  248.  
  249.            zipinfo storage \*
  250.  
  251.      (where the backslash is required only  if  the  shell  would
  252.      otherwise  expand the `*' wildcard, as in Unix when globbing
  253.      is turned on--double quotes around the asterisk  would  have
  254.      worked  as  well).   To turn off the totals line by default,
  255.      use the environment variable (C shell is assumed here):
  256.  
  257.            setenv ZIPINFO --t
  258.  
  259.            zipinfo storage
  260.  
  261.      To get the full, short-format listing of the  first  example
  262.      again,  given that the environment variable is set as in the
  263.      previous example, it is necessary to specify the  -s  option
  264.      explicitly,  since the -t option by itself implies that ONLY
  265.      the footer line is to be printed:
  266.  
  267.            setenv ZIPINFO --t
  268.  
  269.            zipinfo -t storage           [only totals line]
  270.  
  271.            zipinfo -st storage          [full listing]
  272.  
  273.      The -s option, like -m and -l, includes headers and  footers
  274.      by  default, unless otherwise specified.  Since the environ-
  275.      ment variable specified no footers and  that  has  a  higher
  276.      precedence  than  the default behavior of -s, an explicit -t
  277.      option was necessary to produce the full  listing.   Nothing
  278.      was  indicated  about  the header, however, so the -s option
  279.      was sufficient.  Note that both the -h and -t options,  when
  280.      used  by themselves or with each other, override any default
  281.      listing of member files; only the header and/or  footer  are
  282.  
  283. Info-ZIP          Last change: 19 Aug 92 (v1.0)                 5
  284.  
  285. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  286.  
  287.      printed.   This  behavior  will  be more useful when ZipInfo
  288.      accepts wildcards for the zipfile name; one may then summar-
  289.      ize the contents of all zipfiles with a single command.
  290.  
  291.      To list information on a single file within the archive,  in
  292.      medium format, specify the filename explicitly:
  293.  
  294.            zipinfo -m storage unshrink.c
  295.  
  296.      The specification of any member file, as  in  this  example,
  297.      will  override the default header and totals lines; only the
  298.      single line of information about the requested file will  be
  299.      printed.   This  is  intuitively  what one would expect when
  300.      requesting information about a single  file.   For  multiple
  301.      files,  it  is often useful to know the total compressed and
  302.      uncompressed size; in such cases -t may be specified  expli-
  303.      citly:
  304.  
  305.            zipinfo -mt storage "*.[ch] Mak\*
  306.  
  307.      Finally, to get maximal information about the  ZIP  archive,
  308.      use the verbose option.  It is usually wise to pipe the out-
  309.      put into a filter such as more(1):
  310.  
  311.            zipinfo -v storage | more
  312.  
  313. TIPS
  314.      The author finds it convenient to set up an alias ``ii'' for
  315.      ZipInfo  on systems which allow aliases, or else to set up a
  316.      batch  file  ``ii.bat''  or  to  rename  the  executable  to
  317.      ``ii.exe'' on systems such as MS-DOS which have no provision
  318.      for aliases.  The ``ii'' usage parallels the  common  ``ll''
  319.      alias  for long listings in Unix, and the similarity between
  320.      the outputs of the two commands was intentional.
  321.  
  322. SEE ALSO
  323.      funzip(1),  unzip(1),   zip(1),   zipcloak(1),   zipnote(1),
  324.      zipsplit(1)
  325.  
  326. AUTHOR
  327.      Greg Roelofs (also known as Cave Newt).  ZipInfo  is  partly
  328.      based  on  S. H. Smith's unzip and contains pattern-matching
  329.      code by  J.  Kercheval,  but  mostly  it  was  written  from
  330.      scratch.  The OS/2 extra-field code is by Kai Uwe Rommel.
  331.  
  332. Info-ZIP          Last change: 19 Aug 92 (v1.0)                 6
  333.  
  334.