logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

compress.1p (8051B)


  1. '\" et
  2. .TH COMPRESS "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. compress
  12. \(em compress data
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. compress \fB[\fR-fv\fB] [\fR-b \fIbits\fB] [\fIfile\fR...\fB]\fR
  17. .P
  18. compress \fB[\fR-cfv\fB] [\fR-b \fIbits\fB] [\fIfile\fB]\fR
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. .IR compress
  23. utility shall attempt to reduce the size of the named files by using
  24. adaptive Lempel-Ziv coding algorithm.
  25. .TP 10
  26. .BR Note:
  27. Lempel-Ziv is US Patent 4464650, issued to William Eastman, Abraham
  28. Lempel, Jacob Ziv, Martin Cohn on August 7th, 1984, and assigned to
  29. Sperry Corporation.
  30. .RS 10
  31. .P
  32. Lempel-Ziv-Welch compression is covered by US Patent 4558302, issued to
  33. Terry A. Welch on December 10th, 1985, and assigned to Sperry
  34. Corporation.
  35. .RE
  36. .P
  37. On systems not supporting adaptive Lempel-Ziv coding algorithm, the
  38. input files shall not be changed and an error value greater than two
  39. shall be returned. Except when the output is to the standard output,
  40. each file shall be replaced by one with the extension
  41. .BR .Z .
  42. If the invoking process has appropriate privileges, the ownership,
  43. modes, access time, and modification time of the original file are
  44. preserved. If appending the
  45. .BR .Z
  46. to the filename would make the name exceed
  47. {NAME_MAX}
  48. bytes, the command shall fail. If no files are specified, the standard
  49. input shall be compressed to the standard output.
  50. .SH OPTIONS
  51. The
  52. .IR compress
  53. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  54. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  55. .P
  56. The following options shall be supported:
  57. .IP "\fB\-b\ \fIbits\fR" 10
  58. Specify the maximum number of bits to use in a code. For a conforming
  59. application, the
  60. .IR bits
  61. argument shall be:
  62. .RS 10
  63. .sp
  64. .RS 4
  65. .nf
  66. 9 <= \fIbits\fP <= 14
  67. .fi
  68. .P
  69. .RE
  70. .P
  71. The implementation may allow
  72. .IR bits
  73. values of greater than 14. The default is 14, 15, or 16.
  74. .RE
  75. .IP "\fB\-c\fP" 10
  76. Cause
  77. .IR compress
  78. to write to the standard output; the input file is not changed, and no
  79. .BR .Z
  80. files are created.
  81. .IP "\fB\-f\fP" 10
  82. Force compression of
  83. .IR file ,
  84. even if it does not actually reduce the size of the file, or if the
  85. corresponding
  86. .IR file \c
  87. .BR .Z
  88. file already exists. If the
  89. .BR \-f
  90. option is not given, and the process is not running in the background,
  91. the user is prompted as to whether an existing
  92. .IR file \c
  93. .BR .Z
  94. file should be overwritten. If the response is affirmative, the existing
  95. file will be overwritten.
  96. .IP "\fB\-v\fP" 10
  97. Write the percentage reduction of each file to standard error.
  98. .SH OPERANDS
  99. The following operand shall be supported:
  100. .IP "\fIfile\fR" 10
  101. A pathname of a file to be compressed.
  102. .SH STDIN
  103. The standard input shall be used only if no
  104. .IR file
  105. operands are specified, or if a
  106. .IR file
  107. operand is
  108. .BR '\-' .
  109. .SH "INPUT FILES"
  110. If
  111. .IR file
  112. operands are specified, the input files contain the data to be
  113. compressed.
  114. .SH "ENVIRONMENT VARIABLES"
  115. The following environment variables shall affect the execution of
  116. .IR compress :
  117. .IP "\fILANG\fP" 10
  118. Provide a default value for the internationalization variables that are
  119. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  120. .IR "Section 8.2" ", " "Internationalization Variables"
  121. for the precedence of internationalization variables used to determine
  122. the values of locale categories.)
  123. .IP "\fILC_ALL\fP" 10
  124. If set to a non-empty string value, override the values of all the
  125. other internationalization variables.
  126. .IP "\fILC_COLLATE\fP" 10
  127. .br
  128. Determine the locale for the behavior of ranges, equivalence classes,
  129. and multi-character collating elements used in the extended regular
  130. expression defined for the
  131. .BR yesexpr
  132. locale keyword in the
  133. .IR LC_MESSAGES
  134. category.
  135. .IP "\fILC_CTYPE\fP" 10
  136. Determine the locale for the interpretation of sequences of bytes of text
  137. data as characters (for example, single-byte as opposed to multi-byte
  138. characters in arguments), the behavior of character classes used in the
  139. extended regular expression defined for the
  140. .BR yesexpr
  141. locale keyword in the
  142. .IR LC_MESSAGES
  143. category.
  144. .IP "\fILC_MESSAGES\fP" 10
  145. .br
  146. Determine the locale used to process affirmative responses, and the
  147. locale used to affect the format and contents of diagnostic messages,
  148. prompts, and the output from the
  149. .BR \-v
  150. option written to standard error.
  151. .IP "\fINLSPATH\fP" 10
  152. Determine the location of message catalogs for the processing of
  153. .IR LC_MESSAGES .
  154. .SH "ASYNCHRONOUS EVENTS"
  155. Default.
  156. .SH STDOUT
  157. If no
  158. .IR file
  159. operands are specified, or if a
  160. .IR file
  161. operand is
  162. .BR '\-' ,
  163. or if the
  164. .BR \-c
  165. option is specified, the standard output contains the compressed
  166. output.
  167. .SH STDERR
  168. The standard error shall be used only for diagnostic and prompt
  169. messages and the output from
  170. .BR \-v .
  171. .SH "OUTPUT FILES"
  172. The output files shall contain the compressed output. The format of
  173. compressed files is unspecified and interchange of such files between
  174. implementations (including access via unspecified file sharing
  175. mechanisms) is not required by POSIX.1\(hy2008.
  176. .SH "EXTENDED DESCRIPTION"
  177. None.
  178. .SH "EXIT STATUS"
  179. The following exit values shall be returned:
  180. .IP "\00" 6
  181. Successful completion.
  182. .IP "\01" 6
  183. An error occurred.
  184. .IP "\02" 6
  185. One or more files were not compressed because they would have increased
  186. in size (and the
  187. .BR \-f
  188. option was not specified).
  189. .IP >2 6
  190. An error occurred.
  191. .SH "CONSEQUENCES OF ERRORS"
  192. The input file shall remain unmodified.
  193. .LP
  194. .IR "The following sections are informative."
  195. .SH "APPLICATION USAGE"
  196. The amount of compression obtained depends on the size of the input,
  197. the number of
  198. .IR bits
  199. per code, and the distribution of common substrings. Typically, text
  200. such as source code or English is reduced by 50\(hy60%. Compression is
  201. generally much better than that achieved by Huffman coding
  202. or adaptive Huffman coding (\c
  203. .IR compact ),
  204. and takes less time to compute.
  205. .P
  206. Although
  207. .IR compress
  208. strictly follows the default actions upon receipt of a signal or when
  209. an error occurs, some unexpected results may occur. In some
  210. implementations it is likely that a partially compressed file is left
  211. in place, alongside its uncompressed input file. Since the general
  212. operation of
  213. .IR compress
  214. is to delete the uncompressed file only after the
  215. .BR .Z
  216. file has been successfully filled, an application should always
  217. carefully check the exit status of
  218. .IR compress
  219. before arbitrarily deleting files that have like-named neighbors with
  220. .BR .Z
  221. suffixes.
  222. .P
  223. The limit of 14 on the
  224. .IR bits
  225. option-argument is to achieve portability to all systems (within the
  226. restrictions imposed by the lack of an explicit published file
  227. format). Some implementations based on 16-bit architectures cannot
  228. support 15 or 16-bit uncompression.
  229. .SH EXAMPLES
  230. None.
  231. .SH RATIONALE
  232. None.
  233. .SH "FUTURE DIRECTIONS"
  234. None.
  235. .SH "SEE ALSO"
  236. .IR "\fIuncompress\fR\^",
  237. .IR "\fIzcat\fR\^"
  238. .P
  239. The Base Definitions volume of POSIX.1\(hy2017,
  240. .IR "Chapter 8" ", " "Environment Variables",
  241. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  242. .\"
  243. .SH COPYRIGHT
  244. Portions of this text are reprinted and reproduced in electronic form
  245. from IEEE Std 1003.1-2017, Standard for Information Technology
  246. -- Portable Operating System Interface (POSIX), The Open Group Base
  247. Specifications Issue 7, 2018 Edition,
  248. Copyright (C) 2018 by the Institute of
  249. Electrical and Electronics Engineers, Inc and The Open Group.
  250. In the event of any discrepancy between this version and the original IEEE and
  251. The Open Group Standard, the original IEEE and The Open Group Standard
  252. is the referee document. The original Standard can be obtained online at
  253. http://www.opengroup.org/unix/online.html .
  254. .PP
  255. Any typographical or formatting errors that appear
  256. in this page are most likely
  257. to have been introduced during the conversion of the source files to
  258. man page format. To report such errors, see
  259. https://www.kernel.org/doc/man-pages/reporting_bugs.html .