README.TXT 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. A free Macintosh Port of Info-ZIP's
  2. Zip and UnZip
  3. By Dirk Haase, d_haase@sitec.net
  4. Home page: www.sitec.net/maczip
  5. Mirror page:
  6. www.haase-online.de/dirk/maczip
  7. ================================
  8. Abstract:
  9. ---------
  10. MacZip is a cross-platform compatible tool that includes
  11. both Zip (for compression) and UnZip (for extraction).
  12. Zip is a compression and file packaging utility for Unix,
  13. VMS, MSDOS, OS/2, Windows 9x, Windows NT, Atari, Macintosh,
  14. Amiga, Acorn RISC OS, and other systems.
  15. UnZip unpacks zip archives. The Zip and UnZip programs can
  16. process archives produced by PKZIP, and PKZIP and PKUNZIP
  17. can work with archives produced by zip. Zip version 2.2 is
  18. compatible with PKZIP 2.04.
  19. If you are new to MacZip please read first the file
  20. "ReadMe.1st".
  21. License:
  22. --------
  23. Copyright (c) 1990-2001 Info-ZIP. All rights reserved.
  24. See the accompanying file LICENSE, version 2000-Apr-09 or later
  25. (the contents of which are also included in unzip.h) for terms of use.
  26. If, for some reason, all these files are missing, the Info-ZIP license
  27. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  28. Requirements
  29. ------------
  30. MacZip requires at least System 7 and a Macintosh with a
  31. minimum of a Motorola 68020 or PowerPC 601 processor. Other
  32. configurations may work but it is not tested at all.
  33. The application is distributed as a fat binary with both
  34. regular 68K and native PowerPC versions included.
  35. Installation
  36. ------------
  37. Move the executable(s) somewhere--for example, drag it (or
  38. them) to your Applications folder. For easy access, make an
  39. alias in the Launcher Control Panel or directly on your
  40. desktop. The GUI is very simple. It was not my intention to
  41. make a full-blown GUI, however I think it is comfortable
  42. enough to use it as regular tool.
  43. This port supports also Apple-event. So you can install it
  44. in your WWW-Browser as a helper app.
  45. For more Info about the contents of this package, take a
  46. look into the "macos/Contents" (or :macos:Contents) file.
  47. Some notes on how to rebuild the Macintosh applications can
  48. be found in INSTALL.
  49. Usage:
  50. ------
  51. Basically there are four ways to start MacZip:
  52. a) Drag'n Drop
  53. b) using the Dialog box (Menu: File -> Zip/Unzip):
  54. Please read the file "ReadMe.1st"
  55. for the description of the items a and b.
  56. c) Using the Command line (Menu: File->Command Line):
  57. The Zip & UnZip tools are command line tools. So the
  58. behavior is exactly the same like the Zip & UnZip tools on
  59. Unix or Windows/DOS. This means, if you want to zip some
  60. files, you have to write a command line like this: "zip
  61. [switches] path_to_zip_archive path_to_files_folders"
  62. - Go to "File", select "Command Line" and the
  63. "MacZip Entry box" Dialog Box appears.
  64. An example:
  65. a: your zip may be created at
  66. Macintosh HD:applications:archive.zip
  67. b: your files may be found at
  68. Macintosh HD:somewhere:my_folder_to_archive:*
  69. Note: At the end of the path there must be a filename or
  70. a wild card !
  71. (see Footnotes: 1 wild card, 2 Mac path names)
  72. So the command line should look like (one line!):
  73. zip "Macintosh HD:applications:archive.zip" "Macintosh HD:somewhere:my_folder_to_archive:*"
  74. - Click on "Enter" to start the task.
  75. Since you can not set a default folder you have to enter
  76. always a full qualified path names. Full-qualified path
  77. names are path names including the Volume name ! (see
  78. Footnote: 2 Mac path names)
  79. d) Using Applescript:
  80. There is only one additional event defined: "do_cmd". You
  81. can enter every valid command line. The first word must be
  82. "zip" or "unzip" to select the action (compress or
  83. extraction).
  84. See sample Applescript:
  85. tell application "MacZip (PPC)"
  86. activate
  87. with timeout of 90000 seconds
  88. do_cmd "zip -rjjN Volume:archive \"My Volume:*\" "
  89. end timeout
  90. end tell
  91. This script opens MacZip, brings it to the foreground on the
  92. Mac, starts the zip action with the command line: zip -rjjN
  93. Volume:archive "My Volume:*" .
  94. A short introduction is also available online:
  95. http://www.sitec.net/maczip/How-To-Do/
  96. It's possible to stop the run of Zip/Unzip with the well
  97. known shortcut [Command] + [.].
  98. ---------------------------------------------------------------------------
  99. There are some Mac-specific switches available.
  100. Zip Module:
  101. -df [MacOS] Include only data-fork of files zipped into
  102. the archive. Good for exporting files to foreign
  103. operating-systems. Resource-forks will be ignored
  104. at all.
  105. -jj [MacOS] record Fullpath (+ Volname). The complete
  106. path including volume will be stored. By default
  107. the relative path will be stored.
  108. -S [MSDOS, OS/2, WIN32 and ATARI] Include system and
  109. hidden files.
  110. [MacOS] Includes finder invisible files, which are
  111. ignored otherwise.
  112. Unzip Module:
  113. -E [MacOS only] display contents of MacOS extra field
  114. during restore operation.
  115. -i [MacOS only] ignore filenames stored in MacOS extra
  116. fields. Instead, the most compatible filename
  117. stored in the generic part of the entry's header is
  118. used.
  119. -J [MacOS only] ignore MacOS extra fields. All Macin-
  120. tosh specific info is skipped. Data-fork and
  121. resource-fork are restored as separate files.
  122. Select [File]->[Get Help on Zip/Unzip] for a complete list
  123. of switches.
  124. Limitations / Problems:
  125. -----------------------
  126. - Aliases are not supported. I tried, but I got broken
  127. aliases. This port will silently ignore all aliases.
  128. It's on my to-do list for future releases.
  129. - Zip needs much memory to compress many files: You may need
  130. to increase the 'Preferred Size' in 'Get Info'. Values of 12
  131. Megabytes or more are possible
  132. - Unzip needs about 500 Kbytes of memory to unzip no matter
  133. how many files were compressed and expanded.
  134. - and finally one big macintosh-related problem:
  135. This port has one weak point: It's based on path names.
  136. As you may be already know: Path names are not unique on a Mac !
  137. The main reason is that an attempt to implement support exact
  138. saving of the MacOS specific internal file structures would
  139. require a throughout rewrite of major parts of shared code,
  140. probably sacrifying compatibility with other systems. I have
  141. no solution at the moment. The port will just warn you if you
  142. try zip from / to a volume which has a duplicate name.
  143. MacZip has problems to find the archive or the files. My
  144. (Big) recommendation: Name all your volumes with a unique
  145. name and MacZip will run without any problem.
  146. Known Bugs:
  147. - crypted files in a zip archive are sometimes corrupt:
  148. I get an error message: invalid compressed data to inflate.
  149. Appearance of this error is purely be chance: I did a small
  150. test: Unzipping an archive containing 3589 files 56 files
  151. fails to unzip, so about 1.5%. Root cause is completely
  152. unclear to me :(
  153. I strongly recommend to test your archive (e.g. unzip -t archive).
  154. Zip Programs / Macintosh Extra-Data:
  155. -----------------------------------------
  156. A brief overview:
  157. Currently, as far as I know, there are 6 Zip programs
  158. available for the Macintosh platform. These programs build
  159. (of course) different variants of Zip files:
  160. - Info-ZIP's first Port of Zip. Ported by Johnny Lee
  161. This port is rather outdated and no longer supported (since 1992).
  162. 68K only. Only minimal Mac-info is stored
  163. (Creator/Type, Finder attributes). Creator/Type: '????' / '????'
  164. Until year 1998, only UnZip 5.32 survived.
  165. - ZipIt by Tom Brown. This is Shareware and still supported I think.
  166. ZipIt has a nice GUI, but I found it can't handle large Zip files
  167. quite well. ZipIt compresses Macintosh files using the Mac Binary
  168. format. So, transferring files to other platforms is not so easy.
  169. Only minimal Mac-info is stored (Creator/Type, Finder attributes).
  170. Mac filenames are changed to a most compatible filename.
  171. Creator/Type: 'ZIP ' / 'ZIP '
  172. - PKZIP/mac v2.03/210d. This is Shareware.
  173. This Zip implementation for the Mac can be found on ASI's web site
  174. (http://www.asizip.com/products/products.htm). The name of this
  175. program is misleading, it is NOT a product from PKWARE. ASI's last
  176. release version is v2.03, and they also offer a newer beta version
  177. PKZIP/mac 210d. But even the Beta version is rather outdated (1995).
  178. Only minimal Mac-info is stored (Creator/Type, Finder attributes).
  179. The Zipfile format looks like incompatible to other platforms.
  180. (More details about the compatibility issue can be found in
  181. proginfo/3rdparty.bug!). Type: 'PKz1'
  182. Mac filenames are restored without any change.
  183. - Aladdin DropZip 1999, This is Shareware. Aladdin chose
  184. the format of ZipIt. Therefore, it has the some drawbacks
  185. like ZipIt.
  186. Creator/Type: 'SITx' / 'ZIP '
  187. - SmartZip 1.0 1999 - by Marco Bambini Vampire Software.
  188. This is Shareware. SmartZip compresses Macintosh files using the
  189. Mac Binary. Therefore, it has the same drawbacks like ZipIt.
  190. Creator/Type: 'dZIP' / 'ZIP '
  191. and finally:
  192. - Info-ZIP's latest Port of Zip. MacZip 1.0. Ported by me :-)
  193. It is supported (of course) and up to date. Full set of macintosh
  194. info is stored: Creator/Type, Finder attributes, Finder comments,
  195. MacOS 8.0 Folder settings, Icon/Folder Positions ...
  196. Mac filenames are restored without any change.
  197. Creator/Type: 'IZip' / 'ZIP '
  198. Compatibility of my port; Extraction:
  199. - Archives from Info-ZIP's first port (by Johnny Lee) are
  200. still compatible.
  201. - Extraction of ZipIt archives is supported. This support
  202. is not complete: Filenames are correct but Directory names
  203. are sometimes mangled to a DOS compatible form. Segmented
  204. archives are not supported.
  205. - PKZiP/mac archive files are extracted without resource-forks
  206. and without any Finder info. I have no information about
  207. that zip format.
  208. Compatibility of my port; Compression:
  209. - My port supports only the new Info-ZIP format (introduced
  210. with this port). Therefore archives created by MacZip 1.0
  211. (March 1999) must be extracted with this version or later
  212. releases of Info-ZIP's UnZip to restore the complete set of
  213. Macintosh attributes.
  214. Note: This port is complete unrelated to the shareware ZipIt.
  215. Even more, handling of special Macintosh attributes is
  216. incompatible with ZipIt. This port (MacZip) may be used to
  217. extract archives created by ZipIt, but make sure that you
  218. get the result as you expected.
  219. Macintosh Files; File Forks:
  220. ----------------------------
  221. All Macintosh files comprise two forks, known as the data
  222. fork and the resource fork. Unlike the bytes stored in the
  223. resource fork, the bytes in the data fork do not have to
  224. exhibit any particular internal structure. The application
  225. is responsible for interpreting the bytes in the data fork
  226. in whatever manner is appropriate. The bytes in the resource
  227. fork usually have a defined internal structure and contain
  228. data object like menus, dialog boxes, icons and pictures.
  229. Although all Macintosh files contain both a data fork and a
  230. resource fork, one or both of these forks may be empty.
  231. MacZip stores data-forks and resource-forks separately. The
  232. Zipfile format does not allow to store two archive entries
  233. using exactly the same name. My solution is to modify the
  234. Path name of the resource-fork. All resource-fork names are
  235. prepended with a leading special directory named
  236. "XtraStuf.mac". So, when extracting on a Mac, you should
  237. never see this directory "XtraStuf.mac" on your *disk*.
  238. On all foreign systems that support directories in filenames
  239. (e.g.: OS/2, Unix, DOS/Windows, VMS) you will get a
  240. directory "XtraStuf.mac" when extracting MacZip archives.
  241. You can delete the complete directory "XtraStuf.mac" since
  242. Mac resources do not make much sense outside the MacOS
  243. world.
  244. Text encoding; Charsets of the Filenames:
  245. -----------------------------------------
  246. The following information is only important if you plan to
  247. transfer archives across different platforms/language systems:
  248. A typical Zip archive does not support different charsets.
  249. All filenames stored in the public area (= accessible by
  250. foreign systems other than MacOS) must be coded in the
  251. charset ISO-8859-1 (CP1252 in the Microsoft Windows world)
  252. or CP850 (DOSLatin1). The latter should only be used by Zip
  253. programs that mark the archive entries as "created under
  254. DOS". Apart from Macs, the commonly used platforms either
  255. support ISO-8859-1 directly, or are compatible with it. To
  256. achieve maximum compatibility, MacZip convert filenames from
  257. the Mac OS Roman character set to ISO-8859-1 and vice versa.
  258. But not every char of the charset MacRoman has their
  259. equivalent in ISO-8859-1. To make the mapping in most cases
  260. possible, I chose most similar chars or at least the MIDDLE
  261. DOT.
  262. Mac OS Roman character set is used for at least the
  263. following Mac OS localizations: U.S., British, Canadian
  264. French, French, Swiss French, German, Swiss German, Italian,
  265. Swiss Italian, Dutch, Swedish, Norwegian, Danish, Finnish,
  266. Spanish, Catalan, Portuguese, Brazilian, and the default
  267. International system.
  268. In all Mac OS encodings, character codes 0x00-0x7F are
  269. identical to ASCII, except that
  270. - in Mac OS Japanese, yen sign replaces reverse solidus
  271. - in Mac OS Arabic, Farsi, and Hebrew, some of the
  272. punctuation in this range is treated as having strong
  273. left-right directionality, although the corresponding
  274. Unicode characters have neutral directionality
  275. So, for best compatibility, confine filenames to the standard
  276. 7-bit ASCII character set.
  277. If you generate a filename list of your archive (unzip -l),
  278. you will see the converted filenames. Your can also extract
  279. the archive with the switch '-i' (= ignore mac filenames),
  280. and test your result.
  281. This MacZip port uses its own filename stored in the
  282. archive. At the moment, the filename will be not converted.
  283. However, I'm planning to add support for Unicode.
  284. Currently, the following Mac OS encodings are NOT supported:
  285. Japanese, ChineseTrad, Korean, Arabic, Hebrew, Greek,
  286. Cyrillic, Devanagari, Gurmukhi, Gujarati, Oriya, Bengali,
  287. Tamil, Telugu Kannada, Malayalam, Sinhalese, Burmese, Khmer,
  288. Thai, Laotian, Georgian, Armenian, ChineseSimp, Tibetan,
  289. Mongolian, Ethiopic, Vietnamese, ExtArabic and finally:
  290. Symbol - this is the encoding for the font named "Symbol".
  291. Dingbats - this is the encoding for the font named "Zapf Dingbats".
  292. If you extract an archive coded with one of these
  293. charsets you will probably get filenames with funny
  294. characters.
  295. These problems apply only to filenames and NOT to the file
  296. content.
  297. of course: The content of the files will NEVER be converted !!
  298. File-/Creator Type:
  299. -------------
  300. This port uses the creator type 'IZip' and it is registered
  301. at Apple (since 08. March 1998). File types can not be
  302. registered any more. This port uses 'ZIP ' for Zip archive
  303. files. The creator 'IZip' type should be used for all future
  304. versions of MacZip.
  305. Hints for proper restoration of file-time stamps:
  306. -------------------------------------------------
  307. UnZip requires the host computer to have proper time zone
  308. information in order to handle certain tasks correctly (see
  309. unzip.txt). To set the time zone on the Macintosh, go to
  310. the Map Control Panel and enter the correct number of hours
  311. (and, in a few locales, minutes) offset from Universal
  312. Time/Greenwich Mean Time. For example, the US Pacific time
  313. zone is -8 hours from UTC/GMT during standard (winter) time
  314. and -7 hours from UTC/GMT during Daylight Savings Time. The
  315. US Eastern time zone is -5 hours during the winter and -4
  316. hours during the summer.
  317. Discussion of Daylight Savings Time
  318. -----------------------------------
  319. The setting in the Date & Time control panel for Daylight
  320. Savings time is a universal setting. That is, it assumes
  321. everybody in the world is observing Daylight Savings time
  322. when its check box is selected.
  323. If other areas of the world are not observing Daylight
  324. Savings time when the check box is selected in the Date &
  325. Time control panel, then the Map control panel will be off
  326. by an hour for all areas that are not recognizing Daylight
  327. Savings time.
  328. Conversely, if you set the Map control panel to an area that
  329. does not observe Daylight Savings time and deselect/uncheck
  330. the check box for Daylight Savings time in the Date & Time
  331. control panel, then time in all areas celebrating Daylight
  332. Savings time will be off by an hour in the Map control
  333. panel.
  334. Example:
  335. In the case of Hawaiians, sometimes they are three hours
  336. behind Pacific Standard Time (PST) and sometimes two hours
  337. behind Pacific Daylight Time (PDT). The Map control panel
  338. can only calculate differences between time zones relative
  339. to Greenwich Mean Time (GMT). Hawaii will always show up as
  340. three hours past the Pacific time zone and five hours past
  341. the Central time zone.
  342. When Hawaiians are not observing Daylight Savings time, but
  343. the rest of the country is, there is no combination of
  344. settings in Map and Date & Time control panels which will
  345. enable you to display Hawaiian local time correctly AND
  346. concurrently display the correct time in other places that
  347. do observe Daylight Savings time.
  348. The knowledge about which countries observe Daylight Savings
  349. time and which do not is not built into the Map control
  350. panel, so it does not allow for such a complex calculation.
  351. This same situation also occurs in other parts of the world
  352. besides Hawaii. Phoenix, Arizona is an example of an area of
  353. the U.S. which also does not observe Daylight Savings time.
  354. Conclusion:
  355. MacZip only knows the GMT and DST offsets of the
  356. current time, not for the time in question.
  357. Projects & Packages:
  358. --------------------
  359. A Note to version numbers: Version of MacZip is currently
  360. 1.06 and is based on the zip code version 2.3 and unzip code
  361. version 5.42. See About Box for current version and compiler
  362. build date.
  363. Because of the amount of sources I splitted this port into
  364. several projects. See http://www.sitec.net/maczip for
  365. updates.
  366. - core source parts:
  367. unzxxx.zip
  368. zipxxx.zip
  369. These archives contains the main parts of the port. You can
  370. build libraries and a standalone App with Metrowerks
  371. standard console SIOUX. They contain only sources, no
  372. executables. These archives are exact copies of the standard
  373. Info-ZIP source distributions; they were only repackaged
  374. under MacOS using MacZip, with one minor addition: For those
  375. files that are stored in BinHex'ed format in the Info-ZIP
  376. reference source archives, unpacked version that are ready
  377. for use have been added.
  378. - additional source part:
  379. MacZipxxx.zip: contains all the GUI stuff and the project
  380. files to build the main-app. Only sources of the GUI, no
  381. zip or unzip code. To build MacZip successfully you will
  382. need to also download the zip and unzip packages.
  383. - executables:
  384. MacZipxxxnc.hqx: contains only executables and 'README.TXT',
  385. This version is without en-/decryption support !
  386. MacZipxxxc.hqx: contains only executables and 'README.TXT',
  387. This version supports en-/decryption !
  388. - encryption sources:
  389. zcryptxx.zip: To build crypt versions of MacZip.
  390. download from ftp://ftp.icce.rug.nl/infozip/ (and subdirectories)
  391. - documentation:
  392. MacZipDocu.zip: contains some further docus about the algorithm,
  393. limits, Info-ZIP's appnote and a How-to-do Webpage.
  394. Credits:
  395. --------
  396. Macstuff.c and recurse.c: All the functions are from More Files.
  397. More Files fixes many of the broken or underfunctional parts of
  398. the file system. Thanks to Jim Luther. (see morefiles.doc)
  399. ---------------------------------------------------------------------------
  400. Footnotes:
  401. 1. wild card:
  402. The '*' is a wild card and means 'all files'
  403. Just in case you don't know wild cards:
  404. '*' is a place holder for any character.
  405. e.g.:
  406. "this*" matches with "this_file" or "this_textfile" but it
  407. doesn't match with "only_this_file" or "first_this_textfile"
  408. "*this*" matches with "this_file" or "this_textfile" AND
  409. matches with "only_this_file" or "first_this_textfile"
  410. 2. Mac pathnames:
  411. The following characteristics of Macintosh pathnames should
  412. be noted:
  413. A full pathname never begins with a colon, but must contain
  414. at least one colon.
  415. A partial pathname always begins with a colon separator except
  416. in the case where the file partial pathname is a simple file or
  417. directory name.
  418. Single trailing separator colons in full or partial pathnames
  419. are ignored except in the case of full pathnames to volumes.
  420. In full pathnames to volumes, the trailing separator colon is
  421. required.
  422. Consecutive separator colons can be used to ascend a level
  423. from a directory to its parent directory. Two consecutive
  424. separator colons will ascend one level, three consecutive
  425. separator colons will ascend two levels, and so on. Ascending
  426. can only occur from a directory; not a file.
  427. ---------------------------------------------------------------------------
  428. Dirk Haase
  429. ==========