Compress and uncompress files (UNIX)
freeze [-cdfvVz] [[+n1,...,n8] [filename]]...
QNX Neutrino
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.
Normally there are several links set up to the freeze utility. Freeze behaves differently when invoked under these command names:
You can restore compressed files to their original form by:
Or:
When you specify filenames, freeze maintains the ownership, modes, access times, and modification times between the file and its .F version. As a result, you can use freeze for archival purposes, yet you can still use it 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 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 freeze are written to the file so that these characteristics may be adapted to concrete conditions.
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 *
Extract all C source and header files:
melt *.[ch].F
Or:
freeze -d *.[ch].F
View the concatenated contents of all compressed files in the current directory:
fcat *.F | more
Leonid A. Broukhis