Compress and uncompress files (UNIX)
freeze [-cdfvV] [[+n1,n2,...,n8] [filename]]...
The freeze/melt/fcat compression utilities will eventually become deprecated in favor of the GNU zip suite, gzip/gunzip/zcat. The freeze suite of utilities will continue to be provided for quite some time before being eliminated completely. |
The freeze utility compresses the specified files or the standard input. If a file becomes smaller, it's replaced by a file with the extension .F (you can use the -f option to force the creation of the .F file, even if the compressed file is larger). If no files are specified, the compression is applied to the standard input and is written to the standard output.
If you don't specify the -f option, and you run freeze in the foreground, you're prompted as to whether the file should be overwritten.
When a .F file is created, the original file is removed. |
Normally there will be several links set up to the freeze utility which behave differently when invoked under the following command names:
This link: | is equivalent to: |
---|---|
melt | freeze -d |
fcat | freeze -cd |
You can restore compressed files to their original form through either of two ways:
When you specify filenames, freeze maintains the ownership, modes, access times, and modification times between the file and its .F version. As a result, freeze can be used for archival purposes, yet can still be used with make after melting.
The freeze utility uses the Lempel-Ziv algorithm on the first pass and the dynamic Huffman algorithm on the second pass. The size of the "sliding window" is 8K and the maximum length of "matched string" is 256. The positions on the window are coded using a static Huffman table.
A two-byte magic number is prepended to the file to ensure that neither melting of random text nor refreezing of already frozen text is attempted. In addition, the characteristics of the static Huffman table being used during the compression are written to the file so that these characteristics may be reused for other files via the "+n1,n2,...,n8" command line argument.
The amount of compression you obtain depends on the size of the input file and the distribution of character substrings and their probabilities. Typically, text files (e.g. C programs) are reduced by 60% to 75%, while executable files are reduced by 50%. Compression is generally much better than that achieved by LZW coding or by Huffman coding, although it takes more time to compute.
An argument preceded by a + defines the values to use for the Huffman table. You may want to explicitly state these values in order to modify the compression algorithm.
Freeze all files in the current directory:
freeze *
Expand files from a compressed pax archive on floppy:
vol -r /dev/fd0 | melt | pax -r
View the concatenated contents of all compressed files in the current directory:
fcat *.F | more
Leonid A. Broukhis
cpio, fcat, gunzip, gzip, melt, pax, tar, zcat