Comms Corner 9 - originally published in the April 1996 issue of PCW Plus.

This month, we're going to have a look at the myriad compression formats used for storing files on BBSes and the Internet. File compression can cause newcomers to comms a lot of confusion, leaving them wondering why they can't get the software they've downloaded to run.

If you're going to be downloading files, whether it be by FTP from the Internet or just from your local BBS, sooner or later you're going to come across compressed files. Compression is a ubiquitous technique in the world of comms, employed for two important reasons. Firstly, it economises on valuable disc space on the remote site's computer, making it possible to store and offer much more software than would otherwise be possible. Secondly - and from our point of view more importantly - it shortens file transfer time considerably and thus spares you some of the dread of receiving your next phone bill (which needn't be a dread at all if you've been following this series!).

Unfortunately, there exists no single, universally approved compression format. Even if there were one, it would't be long before someone came along with a more efficient technique, people would gradually adopt it, and before long, we'd be faced with a plethora of formats similar to that seen today.

Fortunately, most of the CP/M (de)compression tools are easy to track down and relatively simple to use. Here's an overview of the (de)compression utilities available under CP/M. In addition to the names of the programs, the file extensions they produce and the latest known version numbers of the software are included. Some popular decompressors, such as USQ for unsqueezing files, have been omitted because the technique in question is included as a feature of a more versatile program. An important fact to note is that some compression formats know only a decompressor under CP/M, so you can unpack such archives on the PCW, but not create them yourself. The file extension of the (de)compressors themselves is, of course, always .COM.


Extension Compressor Latest Version Decompressor Latest Version
.ARC/.ARK ARC 2.0 UNARC 1.6
.ZIP n/a n/a UNZIP 1.8
.PMA PMARC 2.0 PMEXT 2.22
.ARJ n/a n/a UNARJ 1.1
.LZH n/a n/a PMEXT 2.22
.?Q? SQ 1.11 UNCRLZH 2.0
.?Z? CRUNCH 2.8 UNCRLZH 2.0
.?Y? CRLZH 2.0 UNCRLZH 2.0
.LBR NULU 1.52a NULU 1.52a
.ZOO n/a n/a BOOZ 1.02
.shar (in Unix) n/a n/a UNSHAR n/a
.TAR n/a n/a UNTAR n/a


Of all of the above compressors, PMARC produces the smallest archives, so use this if you wish to send files to someone else or upload them to a BBS or FTP site. The suite containing PMARC even includes a handy little utility to make self-extracting archives, which means that all a novice has to do to unpack a compressed file is type the name of the archive, causing it to magically unpack its contents. This saves the inexperienced user from having to hunt around for the relevant decompression tool and makes life very easy all round.

For downloading, files with an .LZH extension are even smaller than those produced using PMARC, so download using this format if it's available on the host machine (the compressor will probably be called LHARC) and then decompress with PMEXT. Beware of files compressed using the ZIP software of other platforms (Unix, MSDOS, etc.), for whilst there is a CP/M UNZIP utility, it's not as advanced as its namesakes and won't be able to decompress archives made by them. Unfortunately, all ZIP files bear the same extension, so you can't tell in advance that a particular file will be unusable. It won't be until you try to run it through UNZIP that the compression format not recognised error occurs. If this happens, you can console yourself with the knowledge that the contents, if programs, were unlikely to run under CP/M anyway.

It's worth pointing out that you are very unlikely to encounter some of the above file formats. SHAR, for example, is just a method of concatenating program source code files and doesn't offer any compression as such. ZOO archives are also conspicuous by their absence these days.

Furthermore, archives with an .LBR extension don't necessarily contain compressed files. LBR stands for LiBRary file, and is simply a means of storing a bunch of related files together under a single name for the sake of convenience. The best and most common library manager is NULU (featured on the Soft Option disc, if you still know its whereabouts), which allows you to create and manipulate libraries, but doesn't apply any (de)compression. Unfortunately, this means that you sometimes unpack a library file only to discover that the individual files have been compressed using another utility. Still, after reading this article, you'll know which tool you need to get hold of, won't you? LBR files are nowadays superseded by self-extracting archives, but they are still regularly encountered, so you need to know about them.

You may be wondering why there are no compressors listed for some of the above file formats. How on Earth are the files compressed without using a compressor? Of course, compressors do exist for these formats, but unfortunately not under CP/M. The matching decompression tools have often been produced out of necessity, since if the BBS in your area only offers, say, ARJ compressed downloading, then you're pretty much obliged to use UNARJ or go without reading your mail: not terribly practical!

You should also bear in mind that files can very occasionally be multiply compressed. On a Unix system for example, you might come across a file with the extension .tar.z. After downloading such a file, you'd have to first ZCAT it and then UNTAR it. Luckily, things are very seldom this complicated.

Don't despair if you come across a file that can't be decompressed under CP/M. If your host is a Unix system and you can find your way to the system prompt, try to decompress it there using the tools available (e.g. gunzip for files with a .gz extension) and then repack it as an LZH (or similar) archive before downloading. In actual fact, very few files are truly inaccessible to CP/M. In such a case, you could always download the offending items anyway, e-mail them to a friend with a PC or Mac, and ask him to decompress and repack them in a format you can use and then mail it all back to you. This is admittedly a bit convoluted, but you get your file in the end!

All of the programs discussed in this article are, as usual, available by post from PCW-PD or from various bulletin boards and FTP sites. oak.oakland.edu is probably the only site to carry all of the above, although the programs are spread across many directories and will require some detective work to find. /pub/cpm/starter-kit is a good start. The more common utilities, including the PMARC suite, can be found at ftp.demon.co.uk under /pub/cpm. Those of you with a access to a CD-ROM drive can also find the programs on the Walnut Creek CP/M CD-ROM.

Next month, we'll look at a related topic: file encryption and decryption.

© 1997. Page last updated 31st December 1997