home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / COMPRESS / SMRTZP11.ZIP / SMARTZIP.DOC < prev    next >
Encoding:
Text File  |  1990-08-08  |  18.6 KB  |  379 lines

  1.       SmartZIP (tm) ZIP File Optimizer ■ Version 1.10 ■ August, 1990
  2. Copyright 1989, 1990 ■ Joseph A. Vincent Consulting ■ All Rights Reserved
  3.  
  4.  
  5. If you're reading this before using SmartZIP 1.10, congratulations!  Not
  6. many people are as disciplined and thorough as you are.  However, please
  7. be aware that the file, "READ_ME!.NOW", is MANDATORY READING, since
  8. there are some caveats there that aren't provided here.  Please review
  9. "READ_ME!.NOW" before using SmartZIP 1.10.
  10.  
  11. -----------------------
  12. >>>>> What is SmartZIP?
  13. -----------------------
  14.  
  15. SmartZIP is a ZIP file-size optimizing companion product for PKZIP 1.xx
  16. and PKZIP 0.9x, so don't throw away PKZIP 0.9x yet!  SmartZIP can also
  17. take advantage of PKZIP 0.9x if that version's "Reducing" will yield
  18. better compression for a particular file.  In fact, MUCH of the benefit
  19. of using SmartZIP comes from exploiting PKZIP 0.9x's Reducing algorithm.
  20. SmartZIP, working with PKZIP 1.xx and PKZIP 0.9x, will produce the
  21. absolutely, positively smallest ZIP files possible.
  22.  
  23. SmartZIP is an intelligent ZIP file create/update/reZIP utility that
  24. will minimize both ZIP file size and the time required to create/update
  25. /reZIP an optimized ZIP file.  It does this by using logic that will
  26. always yield the smallest possible ZIP file in a minimum number of
  27. trials.
  28.  
  29. SmartZIP is shareware.  That means that you are encouraged to try it to
  30. see if it meets your needs and, if you decide to keep and use the
  31. program, register it and pay a reasonable fee ($12 per copy suggested).
  32. Those who register SmartZIP will receive:
  33.  
  34.      - "MergZIPs", a program that will merge two existing ZIPs together
  35.        without requiring any intermediate unZIPping of either or both of
  36.        the two ZIPs.  This program is not available as shareware.  It's
  37.        only available as a premium for registering SmartZIP.
  38.  
  39.      - The next release of SmartZIP as soon as it is released.
  40.  
  41. Many hours of hard work have gone into producing SmartZIP and the
  42. accompanying documentation.  I developed SmartZIP because I needed it
  43. and I use it every day.  I think you'll find that SmartZIP produces an
  44. appreciable savings in disk space beyond that saved by using PKZIP alone
  45. at the expense of a nominal amount of extra time spent in doing data
  46. compression.
  47.  
  48. -------------------
  49. >>>>> Why SmartZIP?
  50. -------------------
  51.  
  52. I wrote SmartZIP based on my observation that no single compression
  53. algorithm ALWAYS yields the best compression.  While one file might
  54. compress best with Imploding, another might compress best with Shrinking
  55. or Reducing.  Therefore, it's not possible to obtain the smallest ZIP
  56. file by selecting a single compression algorithm to use for all files to
  57. be ZIPped.  It's not even possible to obtain the smallest ZIP file using
  58. PKZIP 1.xx's "-ex" option.  The ideal is to choose the best compression
  59. algorithm file by file, from PKZIP 1.xx's Imploding/Shrinking and PKZIP
  60. 0.9x's Reducing, and that's what SmartZIP does for you.
  61.  
  62. You'll notice, as you run SmartZIP, that SmartZIP won't use the same
  63. compression algorithm for every file within a given ZIP file.  Since
  64. it's choosing the compression algorithm file-by-file, SmartZIP might,
  65. for example, choose Imploding for one file, Shrinking for another and,
  66. if you're using the "both PKZIPs" option, one of the Reducing levels
  67. from PKZIP 0.9x might be chosen for some other file.  The result is that
  68. the best compression algorithm is chosen for each FILE individually, not
  69. for the COLLECTION of files overall.
  70.  
  71. Is it worth it?  I think so.  The following table provides statistics
  72. for a few files for which Imploding (PKZIP 1.xx's minimize-size
  73. algorithm) did NOT yield the best compression.  The algorithm that
  74. yielded the best compression is marked by an "*".  Statistics are from
  75. PKZIP 1.1 and PKZIP 0.92.
  76.  
  77. ╔══════╤═════════╤════════╤════════╤════════╤════════╤════════╤════════╗
  78. ║ File │ Initial │        │        │ Reduced│ Reduced│ Reduced│ Reduced║
  79. ║ Type │  Bytes  │Imploded│ Shrunk │ Level 4│ Level 3│ Level 2│ Level 1║
  80. ╟──────┼─────────┼────────┼────────┼────────┼────────┼────────┼────────╢
  81. ║      │         │        │        │        │        │        │        ║
  82. ║ .TXT │1,018,954│ 352,084│*326,676│ 365,606│ 373,598│ 384,633│ 387,578║
  83. ║ .TXT │   80,767│  27,762│* 27,194│  30,133│  30,163│  30,750│  31,118║
  84. ║ .BTR │   38,912│   7,461│   7,968│*  7,441│   7,489│   7,582│   7,842║
  85. ║ .TXT │  118,360│   4,374│  12,991│*  4,052│   4,101│   4,291│  19,485║
  86. ║ .TXT │    8,625│   2,794│*  2,605│   2,909│   2,847│   2,759│   2,699║
  87. ║ .EXE │   55,269│  55,389│  55,389│* 55,255│  55,271│  55,274│  55,274║
  88. ║ .ZIP │    5,466│   5,582│   5,582│*  5,458│   5,582│   5,582│   5,582║
  89. ║ .ZIP │    6,083│   6,002│   6,201│*  5,713│   5,765│   5,797│   5,794║
  90. ║ .COM │    6,360│   5,984│   5,922│*  5,261│   5,288│   5,379│   5,394║
  91. ║ .ASP │    7,062│   2,701│   2,434│   2,776│   2,463│   2,300│*  2,184║
  92. ║ .Z00 │   58,428│  36,326│  50,592│* 35,689│  36,307│  36,836│  37,473║
  93. ║ .Z00 │   79,002│  46,353│  67,597│* 45,138│  45,646│  46,525│  48,336║
  94. ║ .Z00 │   88,587│  49,479│  72,578│* 48,044│  48,842│  50,675│  52,095║
  95. ║ .88F │   80,640│  11,877│  13,949│  10,172│  10,138│* 10,097│  10,192║
  96. ║ .ARC │   15,593│  15,167│  15,711│* 14,585│  14,685│  14,810│  14,933║
  97. ║ .COM │    9,516│   5,508│   5,954│*  5,199│   5,303│   5,343│   5,408║
  98. ║ .COM │    7,777│   6,373│   6,715│*  5,755│   5,756│   5,768│   5,856║
  99. ║ .ZIP │   20,608│  20,726│  20,726│* 20,447│  20,649│  20,648│  20,674║
  100. ║ .COM │    6,342│   5,992│   5,915│*  5,256│   5,282│   5,368│   5,386║
  101. ║ .COM │    9,516│   5,508│   5,954│*  5,199│   5,303│   5,343│   5,408║
  102. ║ .EXE │   18,649│  10,101│  11,998│*  9,820│  10,089│  10,236│  10,502║
  103. ║ .PIC │   64,896│  57,906│  65,016│  53,792│  53,618│  53,446│* 53,338║
  104. ║ .PIC │   64,896│  47,195│  51,835│  45,502│  45,256│* 44,879│  44,916║
  105. ║ .PIC │   64,896│  52,502│  59,491│  49,855│  49,518│* 49,062│  49,072║
  106. ║ .PIC │   64,896│  45,584│  48,773│  43,884│  43,503│  42,999│* 42,876║
  107. ║ .PIC │   64,896│  52,084│  58,674│  49,126│  48,694│  48,347│* 48,157║
  108. ╚══════╧═════════╧════════╧════════╧════════╧════════╧════════╧════════╝
  109.  
  110. In general, Imploding is a superior compression algorithm; it yields the
  111. best compression the majority of the time.  However, there are enough
  112. cases where it doesn't to make use of SmartZIP worthwhile.  Graphics
  113. files (.PICs, etc.) and database files, in particular, seem to
  114. compress best with some level of PKZIP 0.9x's Reducing algorithm.
  115.  
  116. -----------------------------
  117. >>>>> How does SmartZIP work?
  118. -----------------------------
  119.  
  120. SmartZIP ZIPs all of the files matching the file specification in the
  121. selected directory into a ZIP file using the ZIP file name specified by
  122. the user.  If the ZIP file exists, it is updated.  If it doesn't exist,
  123. it is created.  If the reZIP ("/r") option is being used, the ZIP file
  124. must exist.
  125.  
  126. For EACH of the files to be ZIPped, SmartZIP first performs PKZIP 1.xx
  127. Imploding.  It then performs PKZIP 1.xx Shrinking.  If you request it,
  128. SmartZIP will also perform PKZIP 0.9x Reducing level 4, and, if Reducing
  129. level 4 yields a smaller ZIP file than either Imploding or Shrinking,
  130. SmartZIP will try the other three Reducing levels, as well, searching
  131. for improved compression.  If Reducing level 4 was no better than
  132. Imploding or Shrinking, no additional compression is attempted.  The
  133. assumption is that, if Reducing level 4 doesn't yield better compression
  134. than Imploding or Shrinking, it is unlikely that other Reducing levels
  135. will, either.  Use of this option is HIGHLY recommended.  The ZIP
  136. produced using the optimum compression algorithm isolated by this
  137. process is then merged into the target ZIP file.
  138.  
  139. If the compression achieved by all of the algorithms used is the same,
  140. then Shrinking (PKZIP 1.xx's minimize-compression-time algorithm) will
  141. be selected.
  142.  
  143. As SmartZIP executes, it will display several things:
  144.  
  145.      - The name of the file being SmartZIPped.
  146.      - The compression algorithm being tried.
  147.      - The compression size achieved by each compression algorithm
  148.        tried.
  149.      - PKZIP's screen output.
  150.  
  151. When the optimum compression algorithm is identified, the compressed
  152. file size achieved will be marked with an asterisk and highlighted, and
  153. an additional message will be displayed stating that SmartZIP is merging
  154. the individual ZIP into the target ZIP file and specifying the
  155. compression algorithm being used.
  156.  
  157. Note that the "compression size" displayed includes the ZIP file
  158. overhead, so it won't match the compressed size of the individual file
  159. exactly; it's usually high by a hundred bytes or so.  Therefore, the
  160. number displayed is only a relative size estimate suitable for the
  161. purpose.
  162.  
  163. --------------------
  164. >>>>> SmartZIP Setup
  165. --------------------
  166.  
  167. SmartZIP.EXE and PKZIP.EXE must both be in in a directory specified in
  168. your PATH.  If you wish to use the option to use both PKZIP 1.xx
  169. Imploding/Shrinking and PKZIP 0.9x Reducing (HIGHLY recommended), you
  170. must rename PKZIP 0.9x's .EXE file from "PKZIP.EXE" to "PKZIP09.EXE" and
  171. place it in a directory specified in your PATH, as well.
  172.  
  173. Make certain that you have ample disk space, particularly if you're
  174. using the "/r" (reZIP) option.  When reZIPping, SmartZIP first unZIPs
  175. the file to be reZIPped.  PKZIP further requires disk space equivalent
  176. to the final ZIP file size.  Although SmartZIP has been tested and
  177. recovers elegantly from a "disk-full" situation, it's better to avoid
  178. such marginal conditions.
  179.  
  180. ---------------------
  181. >>>>> SmartZIP Syntax
  182. ---------------------
  183.  
  184. To run the program, key the following at the DOS prompt:
  185.  
  186.         SMARTZIP [path]zipname [[path]filespec] [/B [/D]] [/K | /O] [/M] [/R]
  187.  
  188.         "zipname"  = the name of the ZIP file to be created or updated.
  189.                      If not specified, the file extension defaults to
  190.                      "ZIP".  If an extension is specified, it must be
  191.                      "ZIP".
  192.         "filespec" = an optional pattern for specifying the files to be
  193.                      SmartZIPped.  Wild cards (* and ?) are supported.
  194.                      The default is to SmartZIP all files (i.e., *.*).
  195.         "/B"       = Use both PKZIPs.  Try 1.xx Imploding/Shrinking
  196.                      AND 0.9x Reducing.  (The default is to try only
  197.                      PKZIP 1.xx Imploding/Shrinking.) SEE NOTE BELOW.
  198.         "/D"       = "Dumb" ZIPping (with "/b" only).  This will force
  199.                      SmartZIP to try ALL four levels of reducing for
  200.                      each file.
  201.         "/K"       = Keep existing ZIP file date.
  202.         "/M"       = "Move" files to the ZIP file.  The default is to
  203.                      add files to the ZIP file.
  204.         "/O"       = Set ZIP date to date of latest file.
  205.         "/R"       = ReZIP the ZIP.
  206.  
  207. NOTE: If you wish to use the "/B" option to use both PKZIP 1.xx
  208.       Imploding/Shrinking and PKZIP 0.9x Reducing (HIGHLY recommended),
  209.       you MUST rename PKZIP 0.9x's .EXE file from "PKZIP.EXE" to
  210.       "PKZIP09.EXE" and place it in a directory in your PATH.
  211.  
  212. SmartZIP has extensive logic for checking syntax and detecting errors.
  213. When SmartZIP detects an error, a high-intensity error message will be
  214. displayed along with an "information panel" showing correct syntax and
  215. brief help information.
  216.  
  217. --------------------------------------
  218. >>>>> Error Return Codes (ERRORLEVELs)
  219. --------------------------------------
  220.  
  221. SmartZIP returns an error code that can be tested within a batch (.BAT)
  222. file using the DOS "ERRORLEVEL" variable.  Since SmartZIP invokes PKZIP
  223. (and PKUNZIP, if you're using the "/r" [reZIP] option), error codes from
  224. the PKWare program will be returned if the PKWare program detects an
  225. error.  In order to avoid confusion between error codes returned from
  226. PKWare programs and those returned by SmartZIP, all SmartZIP error codes
  227. are greater than 100.  PKWare error codes may be found in the PKWare
  228. documentation for PKZIP and PKUNZIP.
  229.  
  230. SmartZIP will return one of the following ERRORLEVELs:
  231.  
  232.        0  No error; normal completion.
  233.    1-100  PKZIP/PKUNZIP return codes.  See PKWare documentation.
  234.      101  Nothing to do.  No ZIP file or parameter specified.
  235.      102  Unrecognized option.
  236.      103  No ZIPname specified.
  237.      104  Excess parameters.
  238.      105  PKZIP.EXE not found on PATH or
  239.           /B option specified and PKZIP09.EXE not found on PATH or
  240.           /R option specified and PKUNZIP.EXE not found on PATH.
  241.      106  ZIP filename extension not valid (i.e., other than ".ZIP").
  242.      107  ZIP filename not valid.
  243.      108  File specification not valid.
  244.      109  ReZIP requested and ZIP file specified does not exist.
  245.      111  No files found matching file specification.
  246.      151  Unable to allocate buffer for merge phase.  Probable memory
  247.           shortage.
  248.      152  Unable to open one or both merge input files during merge
  249.           phase.
  250.      153  Not enough disk space to merge files during merge phase.
  251.      154  Unable to create merged output file during merge phase.
  252.      155  ZIP signature size error. Probable truncated ZIP file.
  253.      156  End central directory signature not found.  Probable truncated
  254.           ZIP file.
  255.  
  256. NOTE: Since SmartZIP creates/updates the ZIP file "in flight", if some
  257. error is encountered (for example, insufficient space remaining on the
  258. disk) that forces SmartZIP termination, the ZIP file, if it exists, will
  259. contain only those files SmartZIPped up to the point of termination.  If
  260. you're using the default ("add" to the ZIP file), you probably won't
  261. care.  However, if you're using the "/M" option ("move" files to the ZIP
  262. file), you should be aware that the ZIP file contains the files that
  263. have already been moved into it and should be retained.
  264.  
  265. ------------------------------------------
  266. >>>>> SmartZIP Execution Time Optimization
  267. ------------------------------------------
  268.  
  269. Although I'm interested in optimum compression, I'm not interested in
  270. infinite execution time.  Although SmartZIP will always identify the
  271. optimum compression algorithm in as few as two trials and never more
  272. than six, there are some things you can do to further minimize SmartZIP
  273. execution time:
  274.  
  275.      - Build the ZIP file on a RAM disk.  Since SmartZIP is write-
  276.        intensive, use of a RAM disk will do more to minimize SmartZIP
  277.        execution time than any other single action you can take.  The
  278.        easiest way to do this is to change to your RAM disk (i.e., get
  279.        to the point where your prompt is your RAM disk's drive letter)
  280.        and execute your SmartZIP command from there.  Paths may be
  281.        specified for the ZIP file and filespec, as necessary.
  282.  
  283.      - Have a large disk cache active.  Since PKZIP.EXE is invoked
  284.        multiple times (and PKZIP09.EXE if you're using the "/b" option)
  285.        and each file being SmartZIPped could be read multiple times, a
  286.        large disk cache will also help significantly.
  287.  
  288. I run SmartZIP with all temporary files residing on a RAM disk and I
  289. also have a 2048K disk cache active.  This results in VERY fast runs,
  290. even on a 6-MHz PC/AT.  On a 20-MHz PS/2 model 80, SmartZIP screams!
  291.  
  292. ---------------------
  293. >>>>> Technical Stuff
  294. ---------------------
  295.  
  296. SmartZIP was written, compiled and tested using Microsoft's Quick C.
  297. The final compilation and testing were done using the Microsoft C
  298. optimizing compiler.
  299.  
  300. SmartZIP creates temporary files named "JVSMRTZP.xxx".  If you terminate
  301. SmartZIP inelegantly (please don't), you might have to delete these
  302. files.
  303.  
  304. -----------------------------------
  305. >>>>> Who Am I and Do I Want Money?
  306. -----------------------------------
  307.  
  308. I'm Joe Vincent and this isn't my day job.  I've put a roof over my
  309. family's heads and food on the table for 30 years as a computing
  310. professional working in large IBM mainframe installations.  I consider
  311. myself one of those fortunate people who get paid for doing what they
  312. love to do.
  313.  
  314. SmartZIP is shareware.  That means that you are encouraged to try it to
  315. see if it meets your needs and, if you decide to keep and use the
  316. program, register it and pay a reasonable fee ($12 per copy suggested).
  317. Those who register SmartZIP will receive:
  318.  
  319.      - "MergZIPs", a program that will merge two existing ZIPs together
  320.        without requiring any intermediate unZIPping of either or both of
  321.        the two ZIPs.  This program is not available as shareware.  It's
  322.        only available as a premium for registering SmartZIP.
  323.  
  324.      - The next release of SmartZIP as soon as it is released.
  325.  
  326. -----------------
  327. >>>>> Recognition
  328. -----------------
  329.  
  330. I want to recognize the significant contribution made to the computing
  331. field in general and data compression technology in particular by Phil
  332. Katz, author of PKZIP, PKUNZIP, et al.  SmartZIP invokes PKZIP via the
  333. Microsoft C "spawn" command.  If it weren't for the incredible
  334. efficiency and speed of PKZIP, SmartZIP wouldn't perform as well as it
  335. does.
  336.  
  337. If you don't already have Phil's ZIP utilities, you can obtain them on
  338. just about any BBS or by contacting PKWare directly at:
  339.  
  340.               PKWARE, Inc.
  341.               7545 North Port Washington Road
  342.               Glendale, WI. 53217
  343.  
  344. ----------------------------
  345. >>>>> Disclaimer of Warranty
  346. ----------------------------
  347.  
  348. This software and documentation are distributed "as is" and without
  349. warranties as to performance or merchantability.  The author makes no
  350. warranties whatsoever, either express or implied, with regard to this
  351. software and other material distributed with this software and hereby
  352. disclaims any and all implied warranties of merchantability or fitness
  353. for a particular purpose.  Because of the diversity of conditions and
  354. hardware under which this software may be used, no warranty of fitness
  355. for a particular purpose is offered.  The user is advised to test the
  356. software thoroughly before relying on it.  The user must assume the
  357. entire risk of using the software.  In no event will the author be
  358. liable for incidental or consequential damages, including, but not
  359. limited to, destruction of data or damage to your equipment.
  360.  
  361. -------------------------
  362. >>>>> Contact Information
  363. -------------------------
  364.  
  365. Registrations, suggestions, comments and reports of anomalous SmartZIP
  366. behavior should be directed to:
  367.  
  368.                    Joe Vincent
  369.                    Joseph A. Vincent Consulting
  370.                    805 Pine Way
  371.                    Anchorage, Kentucky 40223-2361
  372.                    Voice: (502) 244-1541
  373.                     Data: Exec-PC BBS,
  374.                             (414) 789-4210,
  375.                             PC Applications conference,
  376.                             File Compression topic.
  377.                           PKWare BBS,
  378.                             (414) 352-7176
  379.