OSDN Git Service

man/lha.1 was changed a little and the BUGS section was removed.
[lha/lha.git] / man / lha.1
1 .\" -*- indent-tabs-mode: nil -*-
2 .\"
3 .\" Copyright (c) 2008 Koji Arai
4 .\"
5 .\" Permission is hereby granted, free of charge, to any person
6 .\" obtaining a copy of this software and associated documentation files
7 .\" (the "Software"), to deal in the Software without restriction,
8 .\" including without limitation the rights to use, copy, modify, merge,
9 .\" publish, distribute, sublicense, and/or sell copies of the Software,
10 .\" and to permit persons to whom the Software is furnished to do so,
11 .\" subject to the following conditions:
12 .\"
13 .\" The above copyright notice and this permission notice shall be
14 .\" included in all copies or substantial portions of the Software.
15 .\"
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 .\" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 .\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 .\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 .\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 .\" SOFTWARE.
24
25 .TH LHA "1" "February 2008" "LHa for UNIX" "User Commands"
26
27 .SH NAME
28 LHa for UNIX \- Traditional compressor and archiver.
29
30 .SH SYNOPSIS
31
32 lha
33 [\-]\fIcommand\fR[\fIoptions\fR] [\-\fIoptions\fR ...]
34 archive_file.lzh
35 [files...]
36 .TP
37 .B Create an archive
38 .nf
39 lha c archive_file.lzh files or directories.
40 .fi
41 .TP
42 .B Extract the archive
43 .nf
44 lha x archive_file.lzh [specific files]
45 .fi
46 .TP
47 .B List the archive
48 .nf
49 lha l archive_file.lzh [specific files]
50 \.fi
51 or
52 .nf
53 lha archive_file.lzh [specific files]
54 .fi
55 .SH DESCRIPTION
56 The LHa for UNIX is an archiver and compressor using the LZSS and the Huffman encoding compression algorithm.
57 It is possible to create the archive file called the "LZH" file, and possible to extract it.
58
59 It is possible to extract the self-extracting archive file called the SFX file (mainly created on the MS-DOS and the MS-Windows), but impossible to create it.
60
61 .SH COMMANDS
62
63 .TP
64 \fB\-c\fR, \fB\-a\fR
65 Specified files are compressed and archived into an archive file.
66 When the directory path is specified, files under the directory are archived recursively.
67
68 The \fB\-c\fR command creates new archive. When the archive file already exists, it is overwritten.
69 The \fB\-a\fR command creates new archive or appends to existent archive.
70
71 .TP
72 \fB\-x\fR, \fB\-e\fR
73 The \fB\-x\fR command extracts uncompressed files from the archive file.
74 When the specific_files is specified, Only these files or directories are extracted.
75 The \fB\-e\fR command is synonym of \fB\-x\fR.
76
77 .TP
78 \fB\-l\fR, \fB\-v\fR
79 The \fB\-l\fR command lists the contents of archive to stdout. The \fB\-v\fR command is more verbosely command.
80 The term of list is below.
81 .RS
82 .TP
83 PERMISSION
84 For the Unix specific archive, it is permission string like \fBls\fR(1).
85 For the others, it is the string of OS type.
86 .TP
87 UID/GID
88 For the Unix specific archive, it is user-id and group-id.
89 For the others, it is space only.
90 .TP
91 PACKED
92 The size of compressed file. it is shown by the \fB\-v\fR command.
93 .TP
94 SIZE
95 The original file size.
96 .TP
97 RATIO
98 Compressed ratio (PACKED / SIZE * 100).
99 .TP
100 METHOD
101 The string of the compressing method.  it is shown by the \fB\-v\fR command.
102 .RS
103 .TP
104 \-lh0\-
105 no compressed.
106 .TP
107 \-lzs\-
108 2k sliding dictionary (created by the LArc)
109 .TP
110 \-lz4\-
111 no compressed. (created by the LArc)
112 .TP
113 \-lz5\-
114 4k sliding dictionary (created by the LArc)
115 .TP
116 \-lh1\-
117 4k sliding dictionary and dynamic Huffman encoding.
118 .TP
119 \-lh2\-
120 8k sliding dictionary and dynamic Huffman encoding.
121 .TP
122 \-lh3\-
123 8k sliding dictionary and static Huffman encoding.
124 .TP
125 \-lh4\-
126 4k sliding dictionary and static Huffman encoding.
127 .TP
128 \-lh5\-
129 8k sliding dictionary and static Huffman encoding.
130 .TP
131 \-lh6\-
132 32k sliding dictionary and static Huffman encoding.
133 .TP
134 \-lh7\-
135 64k sliding dictionary and static Huffman encoding.
136 .TP
137 \-lhd\- directory
138
139 .RE
140 The LHa for Unix is able to create the methods \-lh0\-, \-lh1\-, \-lh5\-, \-lh6\-, \-lh7\- and \-lhd\-.
141
142 .TP
143 CRC
144 The CRC-16 code. It is shown by the \fB\-v\fR command.
145
146 .TP
147 STAMP
148 The timestamp of the file. It is shown the full-time format with the \fB\-v\fR option.
149
150 .TP
151 LV
152 The header level. It is shown by the \fB\-v\fR option.
153
154 The level 0 and 1 are deprecated. The level 2 header is widely used.
155 The level 3 header is more improved, however, it is rarely used.
156
157 The LHa for Unix is able to create the 0, 1 and 2. (Level 3 is readable.)
158
159 .TP
160 NAME
161 Filename or directory name.
162 .RE
163
164 .TP
165 \fB\-u\fR, \fB\-m\fR
166 The \fB\-u\fR command updates the archive. When the specified files are newer than the content of the archive, they are replaced.
167 The \fB\-m\fR command always replace with the specified files.
168
169 .TP
170 \fB\-d\fR
171 The \fB\-d\fR command delete the specified files from the archive.
172
173 .TP
174 \fB\-p\fR
175 The \fB\-p\fR command print the content of the archived files to stdout.
176 Each contents are printed with filename as header string like below.
177
178     ::::::::
179     filename
180     ::::::::
181     contents of the file.....
182
183 The header string is omitable by the \fB\-q\fR option.
184
185 .TP
186 \fB\-t\fR
187 The \fB\-t\fR command is the same as the \fB\-x\fR command except to non-extract actually.
188 This command is used to check the archive file.
189
190 .SH OPTIONS
191
192 .TP
193 \fB\-q\fR[\fInum\fR]
194 The \fB\-q\fR option specifies the level of quiet mode. \fInum\fR is 0, 1, 2 or nothing.
195
196 The \fB\-q\fR0 option is default level.
197 The \fB\-q\fR1 option inhibits the extracting indicator (progress bar).
198 The \fB\-q\fR2 option inhibits other output decoration. this option has the effects of the \fB\-f\fR option.
199 The \fB\-q\fR is same as \fB\-q\fR2.
200
201 .TP
202 \fB\-v\fR
203 When listing with the \fB\-l\fR or the \fB\-v\fR command, the \fB\-v\fR option lists more verbosely.
204
205 Elements are listed one file per two lines. The first line shows the filename, following line shows other elements and the timestamp (full-time format) and the header level.
206
207 In special case, the \fB\-v\fR command trailing two \fB\-v\fR options like,
208 lha vvv archive_file.lzh
209 shows the header dump. This is a debugging feature.
210
211 .TP
212 \fB\-n\fR
213 The \fB\-n\fR option displays the message instead of doing the command action.
214
215 .TP
216 \fB\-f\fR
217 Force extraction. When extracted file already exists,
218 normally, lha asks for the Overwriting, or Skipping or All files skipping.
219 This option forces overwrite without asking.
220
221 .TP
222 \fB\-t\fR
223 The \fB\-t\fR option treats extracting files as text files.
224 CR codes on the end of each lines are removed. (convert DOS format text to UNIX format text)
225 With the \fB\-e\fR option, KANJI code in extracting files are converted.
226
227 .TP
228 \fB\-o\fR[5\-7]
229 When archiving, the \fB\-o\fR option specifies the compressing method.
230 the \fB\-o\fR5 means to use the \-lh5\- method. It is widely used and default method.
231 the \fB\-o\fR6 and \fB\-o\fR7 means to use the \-lh6\- and \-lh7\- method.
232 These methods reduced archive file more than the \-lh5\- method.
233 Just the \fB\-o\fR means to use the \-lh1\- method.
234
235 It is possible to include some methods in an archive file.
236
237 .TP
238 \fB\-d\fR
239 When archiving, specified files are removed from the disk.
240
241 .TP
242 \fB\-i\fR
243 When extracting, ignore the directory path. extracting file is put flatten on the current directory.
244
245 .TP
246 \fB\-z\fR
247 When archiving, do not compress the specified file. (archive with the \-lh0\- method)
248
249 .TP
250 \fB\-g\fR
251 When extracting, this option does nothing. It exists for historical reason.
252
253 When archiving with this option, archive with general (obsolete) header format.
254 It uses the level 0 header, filename is uppercased in the archive,Unix specific elements such as permission, user-id and so on are not saved.
255
256 .TP
257 \fB\-0\fR, \fB\-1\fR, \fB\-2\fR
258 The \-0, \-1 and \-2 option specifies the version of the format header (called the header level).
259
260 .TP
261 \fB\-e\fR
262 When archiving, the \fB\-e\fR option regard the coding of text as EUC-JP and convert it to Shift_JIS.
263 When extracting, convert from Shift_JIS to EUC-JP.
264
265 .TP
266 \fB\-b\fR
267 When extracting, If it is possible, the MacBinary is interpreted.
268 This option is experimental.
269
270 .TP
271 \fB\-w\fR=\fIdir\fR
272 When extracting, extract files are create in the \fIdir\fR directory.
273
274 An equal mark is omittable like, \-w dir.
275
276 .TP
277 \fB\-x\fR=\fIpattern\fR
278 When archiving, exclude files matched the glob pattern \fIpattern\fR.
279 It is possible to use this option anywhere in the command line.
280
281 An equal mark is omittable like, \-x pattern.
282
283 .SH LONG OPTIONS
284
285 .TP
286 \fB\-\-archive\-kanji\-code\fR={euc,sjis,utf8,cap,none}
287 Specifies the multi-byte encoding of the archived pathname.
288
289 Default is sjis as Shift_JIS.
290
291 On LZH file, the encoding of pathname in archive is not ruled.
292 However, In Japan, Shift_JIS (exactly Windows-31J) is defacto standard.
293
294 .TP
295 \fB\-\-system\-kanji\-code\fR={euc,sjis,utf8,cap,none}
296 This option specifies the encoding of the pathname on the filesystem.
297 Default is euc as EUC-JP.
298
299 .TP
300 \fB\-\-extract\-broken\-archive\fR
301 If CRC error occurrs when extracting, and its archive is created by old version of LHa for UNIX, this option may be last resort.
302
303 .TP
304 \fB\-\-convert\-filename\-case\fR
305 When extracting, the archive format is MS-DOS or Generic, and the
306 whole filename (and directory name) is uppercase, extracted
307 filename will be in lowercase.
308
309 It was default behavior on the old version of the LHa for UNIX.
310 However, many software create the LZH archive with case-sensitive filename even if it is a MS-DOS type archive.
311 Therefore, its behavior was deprecated as default.
312
313 .TP
314 \fB\-\-ignore\-mac\-files\fR
315 When archiving, the Mac specific files are ignored.
316
317 This option is same as the `\fB\-x\fR "._*" \fB\-x\fR ".DS_Store" \fB\-x\fR "Icon\\r"'.
318
319 .TP
320 \fB\-\-traditional\fR
321 Turn on the compatible mode for the old version.
322 For now, same as the \fB\-\-convert\-filename\-case\fR.
323
324 .TP
325 \fB\-\-help\fR
326 Show the briefly usage.
327
328 .TP
329 \fB\-\-version\fR
330 Show the version string.
331
332 .SH SEE ALSO
333 \fBzip\fR(1), \fBunzip\fR(1), \fBgzip\fR(1), \fBgunzip\fR(1), \fBzcat\fR(1)
334
335 .SH AUTHOR
336 Koji Arai <arai@users.sourceforge.jp>
337
338 .SH HISTORY
339 In 1988, Haruhiko Okumura developed the LZARI. It was experimental implementation used the LZSS and the arithmetic coding.
340
341 Kazuhiko Miki developed the LArc. (it was used the \-lzs\- method)
342
343 Haruyasu Yoshizaki developed the LZHUFF (it was experimental code with the LZSS and the Huffman coding), and developed the LHarc version 1.00.
344
345 In 1989, the LHarc was ported on UNIX by Yoichi Tagawa.
346
347 Haruhiko Okumura and Haruyasu Yoshizaki improved the algorithm of the LHarc.
348
349 In 1990, the LHx 2.00 which is the LHarc improvement was implemented by Haruyasu Yoshizaki.
350 The ar002 was implemented by Haruhiko Okumura. It is distributed as the Public Domain Software.
351
352 In 1991, Haruyasu Yoshizaki improved the LHx and renamed to the LHa, and renamed again to the LHA.
353
354 In Japan, This version (LHA 2.10 - 2.13) was widely used on MS-DOS and MS-Windows.
355 Many software and many documents are distributed with this archive format.
356
357 In 1992, It was ported on UNIX by Masaru Oki. It was called the LHa for UNIX, and it was improved by Nobutaka Watazaki, Tsugio Okamoto and many users.
358
359 The LHa for UNIX was used to exchange files for MS-DOS world, and its source codes might be used interestingly and implement another LZH archiver.
360
361 However, its license is vague. so it is not recognized as the Open Source Software defined by the Open Source Initiative.