279 lines
6.8 KiB
Groff
279 lines
6.8 KiB
Groff
.PU
|
|
.TH FREEZE 1 local
|
|
.SH NAME
|
|
freeze, unfreeze, melt, fcat \- compress and uncompress files
|
|
.SH SYNOPSIS
|
|
.ll +8
|
|
.B freeze
|
|
[
|
|
.B \-cdfvVg
|
|
] [
|
|
.I "filename | +type \&..."
|
|
]
|
|
.ll -8
|
|
.br
|
|
.B unfreeze
|
|
[
|
|
.B \-cfvV
|
|
] [
|
|
.I "filename \&..."
|
|
]
|
|
.br
|
|
.B melt
|
|
[
|
|
.B \-cfvV
|
|
] [
|
|
.I "filename \&..."
|
|
]
|
|
.br
|
|
.B fcat
|
|
[
|
|
.I "filename \&..."
|
|
]
|
|
.SH DESCRIPTION
|
|
Compresses the specified files or standard input.
|
|
Each file is replaced by a file with the extension
|
|
.B "\&.F,"
|
|
but only if the file got smaller. If no files are specified,
|
|
the compression is applied to the standard input
|
|
and is written to standard output regardless of the results.
|
|
Compressed files can be restored to their original form by specifying the
|
|
.B \-d
|
|
option, or by running
|
|
.I melt
|
|
or
|
|
.I unfreeze
|
|
(both linked to
|
|
.IR freeze ),
|
|
on the
|
|
.B "\&.F"
|
|
files or the standard input.
|
|
.PP
|
|
If the output file exists, it will not be overwritten unless the
|
|
.B \-f
|
|
flag is given. If
|
|
.B \-f
|
|
is not specified and
|
|
.I freeze
|
|
is run in the foreground,
|
|
the user is prompted
|
|
as to whether the file should be overwritten.
|
|
.PP
|
|
If the
|
|
.B \-g
|
|
flag is given, a slightly less powerful (compression
|
|
rate is 1.5% less), but 40% faster heuristic is used. The more times this
|
|
flag is present, the faster program works and the less compression
|
|
rate is. This flag is quite useful when freezing bitmaps.
|
|
.PP
|
|
If the
|
|
.B \-f
|
|
flag is given, all files specified are replaced with
|
|
.B "\&.F"
|
|
files \- even if the file didn't get smaller.
|
|
.PP
|
|
When file names are given, the ownership (if run by root), modes, accessed
|
|
and modified times are maintained between the file and its
|
|
.B "\&.F"
|
|
version. In this respect,
|
|
.I freeze
|
|
can be used for archival purposes, yet can still be used with
|
|
.IR make "(1)"
|
|
after melting.
|
|
.PP
|
|
The
|
|
.B \-c
|
|
option causes the results of the freeze/melt operation to be written
|
|
to stdout; no files are changed. The
|
|
.I fcat
|
|
program is the same as specifying
|
|
.B \-c
|
|
to
|
|
.I melt
|
|
(all files are unpacked and written to stdout).
|
|
.PP
|
|
The
|
|
.B \-v
|
|
(verbose) option causes the diagnostics (at the end of each file processing)
|
|
to be printed to stderr, and the
|
|
.B \-vv
|
|
option causes the progress indicator to be drawn to the same place.
|
|
.PP
|
|
.I Type
|
|
is a token preceded by a '+', which defines the type
|
|
of following files in the command string. An explicite definition
|
|
of the file's type can give up to 2% of additional compression.
|
|
The list of types is stored in file
|
|
.IR /etc/default/freeze .
|
|
Types may be abbreviated while not ambigious. You can also determine
|
|
values for the static Huffman table by using a list of 8 numbers
|
|
separated by commas instead of
|
|
.I type.
|
|
.PP
|
|
.I Freeze
|
|
uses the Lempel-Ziv algorithm on the first pass and the dynamic
|
|
Huffman algorithm on the second one. 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.
|
|
.PP
|
|
A two byte magic number is prepended to the file
|
|
to ensure that neither melting of random text nor refreezing of
|
|
already frozen text are attempted. In addition, the characteristics
|
|
of the static Huffman table being used during
|
|
.I freeze
|
|
is written to the file so that these characteristics may be adapted
|
|
to concrete conditions.
|
|
.PP
|
|
.ne 8
|
|
The amount of compression obtained depends on the size of the
|
|
input file and the distribution of character substrings and their
|
|
probabilities.
|
|
Typically, text files, such as C programs,
|
|
are reduced by 60\-75%, executable files are reduced by 50%.
|
|
Compression is generally much better than that achieved by
|
|
LZW coding (as used in
|
|
.IR compress ),
|
|
or Huffman coding
|
|
.RI ( pack ),
|
|
though takes more time to compute.
|
|
.PP
|
|
If the
|
|
.B \-V
|
|
(version) flag is given, the program's version number and compilation
|
|
options are printed.
|
|
.PP
|
|
The exit status is normally 0;
|
|
if the last file gets bigger after freezing, the exit status is 2;
|
|
if an error occurs, the exit status is 1.
|
|
.SH "SEE ALSO"
|
|
compact(1), pack(1), compress(1)
|
|
.SH "DIAGNOSTICS"
|
|
Unknown flag:
|
|
.I "\'x\';"
|
|
Usage: freeze [-cdfvVg] [file|+type ...]
|
|
.in +8
|
|
Invalid options were specified on the command line.
|
|
.in -8
|
|
.IR file :
|
|
not in frozen format
|
|
.in +8
|
|
The specified file has not been frozen.
|
|
.in -8
|
|
.IR file :
|
|
already has .F suffix -- no change
|
|
.in +8
|
|
Cannot compress a file that has a ".F" suffix.
|
|
.IR mv "(1)"
|
|
the file to a different name and try again.
|
|
.in -8
|
|
.IR file :
|
|
filename too long to tack on .F
|
|
.in +8
|
|
The specified file cannot be compressed because its filename is longer than
|
|
12 characters.
|
|
.IR mv "(1)"
|
|
the file to a different name and try again. This message does not occur on
|
|
4.XBSD systems.
|
|
.in -8
|
|
.I file
|
|
already exists; do you wish to overwrite (y or n)?
|
|
.in +8
|
|
Respond "y" if you want the output file to be replaced; "n" if you want it
|
|
to be left alone.
|
|
.in -8
|
|
.IR file :
|
|
.IR xx %
|
|
.in +8
|
|
or
|
|
.in -8
|
|
.IR xxx K
|
|
.in +8
|
|
These message fragments are written during the processing of a file, if
|
|
.B \-vv
|
|
option was given in the command line (in percents, if the length of file
|
|
being processed is known; in Kbytes otherwise).
|
|
.in -8
|
|
Freezing:
|
|
.I "xx.xx% (y.yy"
|
|
bits)
|
|
.in +8
|
|
This message fragment gives the percentage of the input file that has been
|
|
saved by freezing and the number of remaining bits per byte of original file.
|
|
.in -8
|
|
-- not a regular file: unchanged
|
|
.in +8
|
|
This message fragment is written when the input file is not a regular file.
|
|
The input file is left unchanged.
|
|
.in -8
|
|
-- has
|
|
.I xx
|
|
other links: unchanged
|
|
.in +8
|
|
This message fragment is written when the input file has links. The input
|
|
file is left unchanged. See
|
|
.IR ln "(1)"
|
|
for more information.
|
|
.in -8
|
|
-- file unchanged
|
|
.in +8
|
|
This message fragment is written when no savings are achieved by
|
|
freezing. The input file is left unchanged.
|
|
.in -8
|
|
-- replaced with
|
|
.I file
|
|
.in +8
|
|
This message fragment is written when a file has been sucessfully
|
|
frozen/melt.
|
|
.in -8
|
|
Using "
|
|
.I type
|
|
" type
|
|
.in +8
|
|
This message indicates a successful switching to
|
|
position table for mentioned file type.
|
|
.in -8
|
|
"
|
|
.I xxx
|
|
" - no such file type
|
|
.in +8
|
|
or
|
|
.in -8
|
|
.I xxx
|
|
- a list of 8 numbers expected
|
|
.in +8
|
|
This message means the given file type does not exist or
|
|
the given string contains a comma, but is not a valid list
|
|
of values for static Huffman table.
|
|
.in -8
|
|
melt: corrupt input
|
|
.in +8
|
|
This message fragment is written when an error in header or
|
|
unexpected end of frozen file is detected. Partial
|
|
(or empty, is there was an error in the header) file is created.
|
|
.in -8
|
|
already frozen -- file unchanged
|
|
.in +8
|
|
This message fragment is written when an input file already has
|
|
Freeze's magic header.
|
|
.in -8
|
|
Invalid position table
|
|
.in +8
|
|
or
|
|
.in -8
|
|
"
|
|
.I type
|
|
" - invalid entry
|
|
.in +8
|
|
These messages appear only if Freeze has been made with incorrect
|
|
data for static Huffman table. It does never appear when freeze
|
|
is called from a public access directory.
|
|
.in -8
|
|
Unknown header format
|
|
.in +8
|
|
Unknown values of flag bits were discovered in the header
|
|
of frozen file.
|
|
.in -8
|
|
.SH "BUGS"
|
|
Found bugs descriptions, incompatibilities, etc. please send to
|
|
leo@s514.ipmce.su.
|