home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unz511.exe / zipinfo.doc < prev   
Text File  |  1994-08-02  |  22KB  |  450 lines

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