⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compress.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>compress</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_168">&nbsp;</a>NAME</h4><blockquote>compress - compress data</blockquote><h4><a name = "tag_001_014_169">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>compress <b>[</b>-fv<b>][</b>-b <i>bits</i><b>][</b><i>file</i> ...<b>]</b> compress <b>[</b>-cfv<b>][</b>-b <i>bits</i><b>][</b><i>file</i><b>]</b> </code></pre></blockquote><h4><a name = "tag_001_014_170">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>compress</i>utility will attempt toreduce the size of the named files byusing adaptive Lempel-Ziv coding.Except when the output is to the standard output, each filewill be replaced by one with the extension.Z.If the invoking process has appropriate privileges, the ownership, modes,access time, and modification time of the original file are preserved.  Ifappending the.Zto the filename would make thename exceed{NAME_MAX}bytes, the command will fail.If no files are specified, the standard input will be compressed to thestandard output.</blockquote><h4><a name = "tag_001_014_171">&nbsp;</a>OPTIONS</h4><blockquote>The<i>compress</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .<p>The following options are supported:<dl compact><dt><b>-b&nbsp;</b><i>bits</i><dd>Specify the maximum number of bits to use in a code.For a portable application, the<i>bits</i>argument must be:<pre><dl compact><dt> <dd>9 &gt;= <i>bits</i> &lt;=  14</dl></pre><p>The implementation may allow<i>bits</i>values of greater than 14.The default will be 14, 15 or 16.<br><dt><b>-c</b><dd>Cause<i>compress</i>to write to the standard output;the input file will not be changed, and no.Zfiles will be created.<br><dt><b>-f</b><dd>Force compression of<i>file</i>,even if it does not actuallyreduce the size of the file,or if the corresponding<i>file</i>.Zfile already exists.If the<b>-f</b>option is not given, and the process is notrunning in the background, the user will be prompted as towhether an existing<i>file</i>.Zfile should be overwritten.<br><dt><b>-v</b><dd>Write the percentage reduction of each file to standard error.<p></dl></blockquote><h4><a name = "tag_001_014_172">&nbsp;</a>OPERANDS</h4><blockquote>The following operand is supported:<dl compact><dt><i>file</i><dd>A pathname of a file to be compressed.</dl></blockquote><h4><a name = "tag_001_014_173">&nbsp;</a>STDIN</h4><blockquote>The standard input will be used only if no<i>file</i>operands are specified, or if a<i>file</i>operand is "-".</blockquote><h4><a name = "tag_001_014_174">&nbsp;</a>INPUT FILES</h4><blockquote>If<i>file</i>operands are specified, the input files contain the data to be compressed.</blockquote><h4><a name = "tag_001_014_175">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>compress</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_176">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_177">&nbsp;</a>STDOUT</h4><blockquote>If no<i>file</i>operands are specified, or if a<i>file</i>operand is "-", or if the<b>-c</b>option is specified, the standard output will contain the compressed output.</blockquote><h4><a name = "tag_001_014_178">&nbsp;</a>STDERR</h4><blockquote>Used for all diagnostic and prompt messagesand the output from<b>-v</b>.</blockquote><h4><a name = "tag_001_014_179">&nbsp;</a>OUTPUT FILES</h4><blockquote>The output files will containthe compressed output.</blockquote><h4><a name = "tag_001_014_180">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_181">&nbsp;</a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>Successful completion.<dt>1<dd>An error occurred.<dt>2<dd>One or more files were not compressedbecause they would have increased in size (and the<b>-f</b>option was not specified).<dt>&gt;2<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_182">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>The input file will remain unmodified.</blockquote><h4><a name = "tag_001_014_183">&nbsp;</a>APPLICATION USAGE</h4><blockquote>The amount of compression obtained depends on the size of theinput, the number of<i>bits</i>per code, and the distribution of common substrings.Typically, text such as source code or Englishis reduced by 50-60%.Compression is generally much better than that achieved byHuffman coding (as used in<i><a href="pack.html">pack</a></i>),or adaptive Huffman coding(<i>compact</i>),and takes less time to compute.<p>Although<i>compress</i>strictly follows the default actions upon receipt of asignal or when an error occurs, some unexpected results may occur.In some implementations it is likely that a partially compressed file will beleft in place, alongside its uncompressed input file.Since the general operation of<i>compress</i>is to delete the uncompressed file only after the.Zfile has been successfully filled, an application should alwayscarefully check the exit status of<i>compress</i>before arbitrarily deletingfiles that have like-named neighbours with.Zsuffixes.<p>Compressed files are not necessarily portable to other systems.<p>The limit of 14 on the<i>bits</i>option-argument is to achieve portability to all systems(within the restrictions imposed by the lack of an explicit publishedfile format).Some systems based on 16-bit architectures cannot support15- or 16-bit uncompression.</blockquote><h4><a name = "tag_001_014_184">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_185">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_186">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="uncompress.html">uncompress</a></i>,<i><a href="zcat.html">zcat</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -