From: Lloyd Wood Subject: What is gzip? What do I need? textfile Date: Sat, 7 May 94 18:35:04 BST What is gzip? What is .gz? is asked on a regular basis in the Mac newsgroups. Attached is an information file I wrote, answering these questions. Although this file is now part of the MacGzip distribution, first the Mac user has to know that he or she needs MacGzip. I hope that uploading this file into the information directories will go some way towards addressing that. -- L. _____________________________________________________________________________ L.H.Wood@student.lut.ac.uk Email me for a copy of the Mac screensaver FAQ From: Lloyd Wood Subject: A real-life use of MacGzip for Mac users! To: macspd@ivo.cps.unizar.es (C) L.H.Wood . All rights reserved. Comments and corrections welcome. Second release - src.doc's umich mirror is /packages/mac-umich, not /packages/umich. Umich's PC and ST archives are also mirrored here, resulting in the changed name. Mentioned Grubb's ftp list. Added notes at end. Minor changes throughout. First release - corrections by SPDSoft, included in the MacGzip 0.2 -> 0.2.1 updater. USING src.doc.ic.ac.uk (146.169.3.7) AS YOUR MAC ARCHIVE SITE A guide to European/UK Mac users wanting to get the most out of a local Mac software archive mirror. US Mac users should look first to wuarchive.wustl.edu as the primary mirror of both info-mac and umich. Mac users running MacTCP should get the latest distribution of Fetch, which includes 'bookmarks' pointing at info-mac mirrors worldwide. Use the bookmark for your local mirror, and see Bruce Grubb's Mac ftp list, posted regularly in the comp.sys.mac.groups and in info-mac/info, for a list of other mirrors and other sites with interesting Mac-related files. src.doc.ic.ac.uk is a large ftp site based at Imperial College in London, England. It mirrors two of the important Mac sites - umich and sumex, or info-mac, and it's updated frequently. Since src.doc allows up to 300 simultaneous users, it would be a good idea to use it as your local Mac mirror, especially if you're in the UK. However, a few eccentricities of the site in comparison with usual Mac archives means that some extra thought is needed in getting files to a Mac. Here's what I've learned. This information is applicable to many other sites which have 'smart' ftp daemons, so it is useful to know even if you never use src.doc. Login as usual: ftp> name: anonymous ftp> password: name@site Putting the email address in your password is just the usual courtesy that lets an archive's maintainers know who is using it. (You can contact src.doc's maintainers at wizards@doc.ic.ac.uk) Look at the readmes at the top level of the archive for up-to-date information on how to retrieve files. I do this for any ftp site I use - it's amazing what tidbits you can pick up. The Mac archives of interest are as directories in packages: /packages/info-mac - a mirror of the info-mac archives at sumex-aim.stanford.edu /packages/mac-umich - a mirror of the umich archives at mac.archive.umich.edu and under those you'll find the familiar directory structures you know and love^H^Hathe^H^H^H^H^H^Hadmire for their logical structure, which makes searching for the file you want immediately obvious should you already happen to have that file's pathname in full. However, you'll be surprised when you come to look at a file - instead of the usual .hqx endings, you will see .hqx.gz instead. The .gz indicates a gzipped file. Gzip is a fairly new unix-originated compression system from the GNU Foundation. It's aimed at replacing the popular unix 'compress' format. [Gzip can also be indicated by .z, although this caused confusion, as other filetypes use the same indication. Not to be confused with .Z, which indicates unix compress files.] To save space on their hard drives, src.doc automatically compresses each of the .hqx files after a while. As this compression is being done on unix boxes, the files are compressed into gzip, rather than being debinhexed and converted to Macbinary as you might expect. It's simply easier for them to do - and as a side-effect it ensures that all files are compressed, even lone Mac files that have been binhexed directly without using a Mac compression package. This has a number of ramifications, though, that affect the way you get files from src.doc.ic.ac.uk. You have two choices here when retrieving files: 1) Get src.doc to give you the expanded, ungzipped form of the file. Normally, you do this by requesting not the filename you are shown, but that filename without the .gz suffix. So, if to download an upgrade to AutoDoubler from src.doc, when it is on info-mac as: info-mac/cmp/autodoubler-203-updt.hqx.gz you would type: ftp> get /packages/info-mac/cmp/autodoubler-203-updt.hqx IF YOU USE FETCH, where you normally just double-click on a file, you must command-click on the highlighted file(s) so that nothing is highlighted. Pressing 'Get File...' button will then give you a dialog asking for the filename. Type in the filename, but without the .gz suffix. [It's annoying that you can't simply copy the filename from the list, and paste it into the Get File dialog, at least with my copy of Fetch 2.1.1. Just deleting the .gz suffix would be easier than remembering long filenames with randomly-place-ddashes-likethis-1.0.sit.hqx] Using ftp or Fetch, this gets you a binhex file, which is decoded as normal to give you a Mac archive. You should be thinking 'What an awkward way to use an archive!' And you're right. Try logging in to src.doc again, but this time with a plus as the first letter of your password (i.e +name@site). You will see that all of the .gz suffixes have vanished, as that plus tells src.doc to hide them. You can then use src.doc like any other Mac archive site, pointing and clicking as normal in Fetch, and that extra compression/translation stage is completely hidden from you and from your ftp tools. However, that gzipping means extra compression - which means less time to get the file you want to you. What if you grabbed the smaller gzipped file as it is, and then decompressed it at your end? This brings us to method 2). 2) Get the gzipped file as you would any other, and un-gzip it on your unix box or back at your Mac. This requires that you transfer the file in BINARY mode, which is selected by: ftp> bin or, if you use Fetch, by clicking on the Binary radio-button. Un-gzipping locally requires that you have received the file successfully in binary mode - if you can't un-gzip the file correctly, it's likely that you haven't got a reliable binary path between src.doc and your machine. If you can't transfer files reliably in binary mode, stick to logging in with + at the start of your password. If you are bringing the file to a unix box, you can un-gzip it there - talk to your systems manager to see if the gzip software you require is present. You'll then have a (larger) binhex file to copy to a Mac. Alternatively, you can un-gzip the file on your Mac. This requires MacGzip, a port of unix gzip 1.2.4, which you'll find in the compression folders of the mac archives - e.g. info-mac/cmp/macgzip-02.cpt.hqx. (This textfile you are reading is included in the MacGzip distribution, so it's possible that you already have MacGzip. Lucky you! Don't forget to email macspd@ivo.cps.unizar.es and say how much you appreciate his work.) Once MacGzip has un-gzipped the file, you'll have a binhex (.hqx) file ready for debinhexing. Depending on the debinhexer you use, you may need to change the filetype to 'TEXT', so that your debinhexing utility can see it in its Open dialog. (Compact Pro is fussy and requires this; Stuffit Lite does not.) MacGzip will save the binhex file as TEXT when the 'ascii' menu item is selected; the option is remembered in the preferences. Note that MacGzip has the following peculiarities: a. Gzipped files should be of type 'Gzip'. You can set this with Fetch (see below), or by using ResEdit or a file type/creator utility such as FileTyper 4.1. If you set the creator to 'Gzip' as well, you will see MacGzip's icon (a tiny g in a small page) for the file. b. MacGzip will only see and open files with suffixes matching the suffix in its preferences dialog and ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" or "_z". You're unlikely to come across another weird suffix, so you can simply delete the suffix field and leave it blank. You will still be able to see all the files with standard suffixes. c. If you expect to double-clicking on MacGzip files to have them expanded, make sure you have MacGzip set to 'uncompress' and to 'quit when done' to save your Mac's memory. IF YOU USE FETCH, it's a good idea to tell it that gzipped files must be fetched in binary mode, so that it can automatically select it without you having to remember to set binary mode explicitly each time. To do this, use the 'Suffix Mapping...' option under Fetch's 'Customize' menu, setting type and creator to 'Gzip' as described in a. above, so that MacGzip can see the files that Fetch creates. Then set the 'Post-Processing...' option on the same menu to get Fetch to run MacGzip automatically for you, so that pointing and clicking in Fetch gives you a recognizable .hqx file. [If you figure out how to get Fetch 2.1.1 to un-gzip and *then* debinhex an archive automatically, let me know! Debinhexing is on MacGzip's 'Things to Do' list, so this may soon be automatic.] You can also get a non-gzipped file to be gzipped before it is sent to you, so that it spends less time in transit to your modem, command-click on the highlighted file(s) so that nothing is highlighted. The 'Get File...' button will then ask for a filename. Select this, and enter the filename, with an extra .gz suffix. If you've set Suffix Mapping and Post-Processing correctly, Fetch will have the file un-gzipped for you automatically once it has been completely downloaded. A little thought, and smashing the keyboard because I couldn't get into US archives, even on weekends, became a thing of the past. And I've cut downloading times when actually getting files with my modem, too. And that means cutting my phone bills. I'm happy. But should I be telling you all this painstakingly-discovered infomation? After all, you overload sumex with your constant requests for connections. I wonder how long it will be before I can't get into src.doc either? Two further notes: As gzip is a unix-orientated system, it doesn't know about the peculiarities of Mac files. You can't store a Mac file inside a gzip archive unless you binhex or macbinary the Mac file before compressing it. Uploading Mac files to archives in gzip format is a no-no - everyone has Stuffit Lite and Compact Pro, so use one of those two. gzip would be an obvious format to add to Stuffit's collection of translators and perhaps to Stuffit Expander. However, GNU's legal licence causes problems with including the code in a commercial product. We have MacGzip, but if someone could figure out the undocumented interface for Stuffit translators and write a gzip translator, that would be very nice indeed. END. L.H.Wood@lut.ac.uk Got a Mac? Got a screensaver? Read the Screensaver FAQ!