home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / compress / zip / windows / win95 / zipinfo.doc < prev   
Encoding:
Text File  |  1994-08-25  |  21.1 KB  |  451 lines

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