summaryrefslogtreecommitdiffstats
path: root/doc/tarlz.info
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--doc/tarlz.info213
1 files changed, 121 insertions, 92 deletions
diff --git a/doc/tarlz.info b/doc/tarlz.info
index 25ba882..46d5ab4 100644
--- a/doc/tarlz.info
+++ b/doc/tarlz.info
@@ -11,12 +11,13 @@ File: tarlz.info, Node: Top, Next: Introduction, Up: (dir)
Tarlz Manual
************
-This manual is for Tarlz (version 0.25, 3 January 2024).
+This manual is for Tarlz (version 0.26, 7 December 2024).
* Menu:
* Introduction:: Purpose and features of tarlz
* Invoking tarlz:: Command-line interface
+* Argument syntax:: By convention, options start with a hyphen
* Portable character set:: POSIX portable filename character set
* File format:: Detailed format of the compressed archive
* Amendments to pax format:: The reasons for the differences with pax
@@ -92,7 +93,7 @@ in a way compatible with standard tar tools. *Note crc32::.
be used to check that the format of the archive is compatible with tarlz.

-File: tarlz.info, Node: Invoking tarlz, Next: Portable character set, Prev: Introduction, Up: Top
+File: tarlz.info, Node: Invoking tarlz, Next: Argument syntax, Prev: Introduction, Up: Top
2 Invoking tarlz
****************
@@ -127,7 +128,7 @@ member names in the archive or given in the command line, so that
setting is used. For example '-9 --solid --uncompressed -1' is equivalent
to '-1 --solid'.
- tarlz supports the following operations:
+tarlz supports the following operations:
'--help'
Print an informative help message describing the options and exit.
@@ -240,7 +241,7 @@ to '-1 --solid'.
used as compressor for GNU tar by using a command like
'tar -c -Hustar foo | tarlz -z -o foo.tar.lz'. Tarlz can be used as
compressor for zupdate (zutils) by using a command like
- 'zupdate --lz="tarlz -z" foo.tar.gz'. Note that tarlz only works
+ 'zupdate --lz='tarlz -z' foo.tar.gz'. Note that tarlz only works
reliably on archives without global headers, or with global headers
whose content can be ignored.
@@ -249,7 +250,7 @@ to '-1 --solid'.
end-of-archive block is found, and then compresses the rest of the
archive. Unless solid compression is requested, the end-of-archive
blocks are compressed in a lzip member separated from the preceding
- members and from any non-zero garbage following the end-of-archive
+ members and from any nonzero garbage following the end-of-archive
blocks. '--compress' implies plzip argument style, not tar style. Each
input archive is compressed to a file with the extension '.lz' added
unless the option '--output' is used. When '--output' is used, only
@@ -268,8 +269,7 @@ to '-1 --solid'.
(lzlib)Library version.
- tarlz supports the following options: *Note Argument syntax:
-(arg_parser)Argument syntax.
+tarlz supports the following options: *Note Argument syntax::.
'-B BYTES'
'--data-size=BYTES'
@@ -281,17 +281,18 @@ to '-1 --solid'.
'-C DIR'
'--directory=DIR'
Change to directory DIR. When creating, appending, comparing, or
- extracting, the position of each '-C' option in the command line is
+ extracting, the position of each option '-C' in the command line is
significant; it changes the current working directory for the following
- FILES until a new '-C' option appears in the command line. '--list'
- and '--delete' ignore any '-C' options specified. DIR is relative to
- the then current working directory, perhaps changed by a previous '-C'
- option.
+ FILES until a new option '-C' appears in the command line. '--list'
+ and '--delete' ignore any option '-C' specified. DIR is relative to
+ the then current working directory, perhaps changed by a previous
+ option '-C'.
Note that a process can only have one current working directory (CWD).
Therefore multi-threading can't be used to create or decode an archive
- if a '-C' option appears after a (relative) file name in the command
- line. (All file names are made relative when decoding).
+ if an option '-C' appears after a (relative) file name in the command
+ line. (All file names are made relative by removing leading slashes
+ when decoding).
'-f ARCHIVE'
'--file=ARCHIVE'
@@ -307,10 +308,10 @@ to '-1 --solid'.
'-n N'
'--threads=N'
Set the number of (de)compression threads, overriding the system's
- default. Valid values range from 0 to "as many as your system can
- support". A value of 0 disables threads entirely. If this option is
- not used, tarlz tries to detect the number of processors in the system
- and use it as default value. 'tarlz --help' shows the system's default
+ default. Valid values range from 0 to as many as your system can
+ support. A value of 0 disables threads entirely. If this option is not
+ used, tarlz tries to detect the number of processors in the system and
+ use it as default value. 'tarlz --help' shows the system's default
value. See the note about multi-threading in the option '-C' above.
Note that the number of usable threads is limited during compression to
@@ -347,6 +348,7 @@ to '-1 --solid'.
reducing the amount of memory required for decompression.
Level Dictionary size Match length limit
+ --------------------------------------------
-0 64 KiB 16 bytes
-1 1 MiB 5 bytes
-2 1.5 MiB 6 bytes
@@ -496,9 +498,52 @@ indicate a corrupt or invalid input file, 3 for an internal consistency
error (e.g., bug) which caused tarlz to panic.

-File: tarlz.info, Node: Portable character set, Next: File format, Prev: Invoking tarlz, Up: Top
+File: tarlz.info, Node: Argument syntax, Next: Portable character set, Prev: Invoking tarlz, Up: Top
-3 POSIX portable filename character set
+3 Syntax of command-line arguments
+**********************************
+
+POSIX recommends these conventions for command-line arguments.
+
+ * A command-line argument is an option if it begins with a hyphen ('-').
+
+ * Option names are single alphanumeric characters.
+
+ * Certain options require an argument.
+
+ * An option and its argument may or may not appear as separate tokens.
+ (In other words, the whitespace separating them is optional). Thus,
+ '-o foo' and '-ofoo' are equivalent.
+
+ * One or more options without arguments, followed by at most one option
+ that takes an argument, may follow a hyphen in a single token. Thus,
+ '-abc' is equivalent to '-a -b -c'.
+
+ * Options typically precede other non-option arguments.
+
+ * The argument '--' terminates all options; any following arguments are
+ treated as non-option arguments, even if they begin with a hyphen.
+
+ * A token consisting of a single hyphen character is interpreted as an
+ ordinary non-option argument. By convention, it is used to specify
+ standard input, standard output, or a file named '-'.
+
+GNU adds "long options" to these conventions:
+
+ * A long option consists of two hyphens ('--') followed by a name made
+ of alphanumeric characters and hyphens. Option names are typically one
+ to three words long, with hyphens to separate words. Abbreviations can
+ be used for the long option names as long as the abbreviations are
+ unique.
+
+ * A long option and its argument may or may not appear as separate
+ tokens. In the latter case they must be separated by an equal sign '='.
+ Thus, '--foo bar' and '--foo=bar' are equivalent.
+
+
+File: tarlz.info, Node: Portable character set, Next: File format, Prev: Argument syntax, Up: Top
+
+4 POSIX portable filename character set
***************************************
The set of characters from which portable file names are constructed.
@@ -516,7 +561,7 @@ names use only the portable character set without spaces added.

File: tarlz.info, Node: File format, Next: Amendments to pax format, Prev: Portable character set, Up: Top
-4 File format
+5 File format
*************
In the diagram below, a box like this:
@@ -534,10 +579,10 @@ In the diagram below, a box like this:
represents a variable number of bytes or a fixed but large number of
bytes (for example 512).
-
- A tar.lz file consists of one or more lzip members (compressed data
-sets). The members simply appear one after another in the file, with no
-additional information before, between, or after them.
+A tar.lz file consists of one or more lzip members (compressed data sets).
+The members simply appear one after another in the file, with no additional
+information before, between, or after them. Empty members (data size = 0)
+are not allowed in multimember files.
Each lzip member contains one or more tar members in a simplified POSIX
pax interchange format. The only pax typeflag value supported by tarlz (in
@@ -570,7 +615,7 @@ binary zeros, interpreted as an end-of-archive indicator. These EOA blocks
are either compressed in a separate lzip member or compressed along with the
tar members contained in the last lzip member. For a compressed archive to
be recognized by tarlz as appendable, the last lzip member must contain
-between 512 and 32256 zeros alone (without any non-zero bytes).
+between 512 and 32256 zeros alone (without any nonzero bytes).
The diagram below shows the correspondence between each tar member
(formed by one or two headers plus optional data) in the tar archive and
@@ -587,15 +632,14 @@ tar.lz
| member | member | member |
+===============+=================================================+========+
-
-4.1 Pax header block
+5.1 Pax header block
====================
The pax header block is identical to the ustar header block described below
except that the typeflag has the value 'x' (extended). The field 'size' is
the size of the extended header data in bytes. Most other fields in the pax
header block are zeroed on archive creation to prevent trouble if the
-archive is read by an ustar tool, and are ignored by tarlz on archive
+archive is read by a ustar tool, and are ignored by tarlz on archive
extraction. *Note flawed-compat::.
Tarlz limits the size of the pax extended header data so that the whole
@@ -682,14 +726,14 @@ space, equal-sign, and newline.
At verbosity level 1 or higher tarlz prints a diagnostic for each unknown
extended header keyword found in an archive, once per keyword.
-
-4.2 Ustar header block
+5.2 Ustar header block
======================
The ustar header block has a length of 512 bytes and is structured as shown
-in the following table. All lengths and offsets are in decimal.
+in the following table. All lengths and offsets are in decimal:
Field Name Offset Length (in bytes)
+---------------------------------------
name 0 100
mode 100 8
uid 108 8
@@ -810,7 +854,7 @@ longer than standard ustar by not requiring a terminating null character.

File: tarlz.info, Node: Amendments to pax format, Next: Program design, Prev: File format, Up: Top
-5 The reasons for the differences with pax
+6 The reasons for the differences with pax
******************************************
Tarlz creates safe archives that allow the reliable detection of invalid or
@@ -821,8 +865,7 @@ achieve this goal and avoid some other flaws in the pax format, tarlz makes
some changes to the variant of the pax format that it uses. This chapter
describes these changes and the concrete reasons to implement them.
-
-5.1 Add a CRC of the extended records
+6.1 Add a CRC of the extended records
=====================================
The POSIX pax format has a serious flaw. The metadata stored in pax extended
@@ -849,8 +892,7 @@ place.
Redundancy Check (CRC) in a way compatible with standard tar tools. *Note
key_crc32::.
-
-5.2 Remove flawed backward compatibility
+6.2 Remove flawed backward compatibility
========================================
In order to allow the extraction of pax archives by a tar utility conforming
@@ -878,13 +920,12 @@ violations during parallel extraction.
If an extended header is required for any reason (for example a file
size of 8 GiB or larger, or a link name longer than 100 bytes), tarlz also
-moves the file name to the extended records to prevent an ustar tool from
+moves the file name to the extended records to prevent a ustar tool from
trying to extract the file or link. This also makes easier during parallel
decoding the detection of a tar member split between two lzip members at
the boundary between the extended header and the ustar header.
-
-5.3 As simple as possible (but not simpler)
+6.3 As simple as possible (but not simpler)
===========================================
The tarlz format is mainly ustar. Extended pax headers are used only when
@@ -899,8 +940,7 @@ corruption.
ignored. Some operations may not behave as expected if the archive contains
global headers.
-
-5.4 Improve reproducibility
+6.4 Improve reproducibility
===========================
Pax includes by default the process ID of the pax process in the ustar name
@@ -912,8 +952,7 @@ extended records, making it easier to produce reproducible archives.
ten; '99<97_bytes>' or '100<97_bytes>'. Tarlz minimizes the length of the
record and always produces a length of x-1 in these cases.
-
-5.5 No data in hard links
+6.5 No data in hard links
=========================
Tarlz does not allow data in hard link members. The data (if any) must be in
@@ -922,8 +961,7 @@ the names of a file are stored as hard links, the type of the file is lost.
Not allowing data in hard links also prevents invalid actions like
extracting file data for a hard link to a symbolic link or to a directory.
-
-5.6 Avoid misconversions to/from UTF-8
+6.6 Avoid misconversions to/from UTF-8
======================================
There is no portable way to tell what charset a text string is coded into.
@@ -935,7 +973,7 @@ be adjusted with a command-line option in the future.

File: tarlz.info, Node: Program design, Next: Multi-threaded decoding, Prev: Amendments to pax format, Up: Top
-6 Internal structure of tarlz
+7 Internal structure of tarlz
*****************************
The parts of tarlz related to sequential processing of the archive are more
@@ -947,7 +985,7 @@ processing.
creation is somewhat similar to that of plzip with the added complication
of the solidity levels. *Note Program design: (plzip)Program design. A
grouper thread and several worker threads are created, acting the main
-thread as muxer (multiplexer) thread. A "packet courier" takes care of data
+thread as muxer (multiplexer) thread. A 'packet courier' takes care of data
transfers among threads and limits the maximum number of data blocks
(packets) being processed simultaneously.
@@ -993,8 +1031,8 @@ the archive.
As misaligned tar.lz archives can't be decoded in parallel, and the
misalignment can't be detected until after decoding has started, a
-"mastership request" mechanism has been designed that allows the decoding to
-continue instead of signalling an error.
+'mastership request' mechanism has been designed that allows the decoding to
+continue instead of exiting with an error.
During parallel decoding, if a worker finds a misalignment, it requests
mastership to decode the rest of the archive. When mastership is requested,
@@ -1015,15 +1053,15 @@ error be avoided.

File: tarlz.info, Node: Multi-threaded decoding, Next: Minimum archive sizes, Prev: Program design, Up: Top
-7 Limitations of parallel tar decoding
+8 Limitations of parallel tar decoding
**************************************
-Safely decoding an arbitrary tar archive in parallel is only possible if one
-decodes the headers sequentially first. For example, if a tar archive
-containing another tar archive is decoded starting from some position other
-than the beginning, there is no way to know if the first header found there
-belongs to the outer tar archive or to the inner tar archive. Tar is a
-format inherently serial; it was designed for tapes.
+Safely decoding a tar archive in parallel is only possible if one decodes
+the headers sequentially first. For example, if a tar archive containing
+another tar archive is decoded starting from some position other than the
+beginning, there is no way to know if the first header found there belongs
+to the outer tar archive or to the inner tar archive. Tar is a format
+inherently serial; it was designed for tapes.
The pax format is even more serial than the ustar format. Two headers
need to be decoded sequentially for each file. The extended header may even
@@ -1071,8 +1109,7 @@ the tar member data because it only decodes the part of each lzip member
corresponding to the tar member header. This is another reason why the tar
headers must provide their own integrity checking.
-
-7.1 Limitations of multi-threaded extraction
+8.1 Limitations of multi-threaded extraction
============================================
Multi-threaded extraction may produce different output than single-threaded
@@ -1102,7 +1139,7 @@ links to.

File: tarlz.info, Node: Minimum archive sizes, Next: Examples, Prev: Multi-threaded decoding, Up: Top
-8 Minimum archive sizes required for multi-threaded block compression
+9 Minimum archive sizes required for multi-threaded block compression
*********************************************************************
When creating or appending to a compressed archive using multi-threaded
@@ -1140,21 +1177,19 @@ Level

File: tarlz.info, Node: Examples, Next: Problems, Prev: Minimum archive sizes, Up: Top
-9 A small tutorial with examples
-********************************
+10 A small tutorial with examples
+*********************************
Example 1: Create a multimember compressed archive 'archive.tar.lz'
containing files 'a', 'b' and 'c'.
tarlz -cf archive.tar.lz a b c
-
Example 2: Append files 'd' and 'e' to the multimember compressed archive
'archive.tar.lz'.
tarlz -rf archive.tar.lz d e
-
Example 3: Create a solidly compressed appendable archive 'archive.tar.lz'
containing files 'a', 'b' and 'c'. Then append files 'd' and 'e' to the
archive.
@@ -1162,7 +1197,6 @@ archive.
tarlz --asolid -cf archive.tar.lz a b c
tarlz --asolid -rf archive.tar.lz d e
-
Example 4: Create a compressed appendable archive containing directories
'dir1', 'dir2' and 'dir3' with a separate lzip member per directory. Then
append files 'a', 'b', 'c', 'd' and 'e' to the archive, all of them
@@ -1172,31 +1206,26 @@ contains 5 lzip members (including the end-of-archive member).
tarlz --dsolid -cf archive.tar.lz dir1 dir2 dir3
tarlz --asolid -rf archive.tar.lz a b c d e
-
Example 5: Create a solidly compressed archive 'archive.tar.lz' containing
files 'a', 'b' and 'c'. Note that no more files can be later appended to
the archive.
tarlz --solid -cf archive.tar.lz a b c
-
Example 6: Extract all files from archive 'archive.tar.lz'.
tarlz -xf archive.tar.lz
-
Example 7: Extract files 'a' and 'c', and the whole tree under directory
'dir1' from archive 'archive.tar.lz'.
tarlz -xf archive.tar.lz a c dir1
-
Example 8: Copy the contents of directory 'sourcedir' to the directory
'destdir'.
tarlz -C sourcedir --uncompressed -cf - . | tarlz -C destdir -xf -
-
Example 9: Compress the existing POSIX archive 'archive.tar' and write the
output to 'archive.tar.lz'. Compress each member individually for maximum
availability. (If one member in the compressed archive gets damaged, the
@@ -1204,13 +1233,11 @@ other members can still be extracted).
tarlz -z --no-solid archive.tar
-
Example 10: Compress the archive 'archive.tar' and write the output to
'foo.tar.lz'.
tarlz -z -o foo.tar.lz archive.tar
-
Example 11: Concatenate and compress two archives 'archive1.tar' and
'archive2.tar', and write the output to 'foo.tar.lz'.
@@ -1219,7 +1246,7 @@ Example 11: Concatenate and compress two archives 'archive1.tar' and

File: tarlz.info, Node: Problems, Next: Concept index, Prev: Examples, Up: Top
-10 Reporting bugs
+11 Reporting bugs
*****************
There are probably bugs in tarlz. There are certainly errors and omissions
@@ -1241,6 +1268,7 @@ Concept index
* Menu:
* Amendments to pax format: Amendments to pax format. (line 6)
+* argument syntax: Argument syntax. (line 6)
* bugs: Problems. (line 6)
* examples: Examples. (line 6)
* file format: File format. (line 6)
@@ -1259,25 +1287,26 @@ Concept index

Tag Table:
Node: Top216
-Node: Introduction1207
-Node: Invoking tarlz4032
-Ref: --data-size13076
-Ref: --bsolid17512
-Node: Portable character set23425
-Node: File format24068
-Ref: key_crc3231050
-Ref: ustar-uid-gid34315
-Ref: ustar-mtime35122
-Node: Amendments to pax format37125
-Ref: crc3237834
-Ref: flawed-compat39146
-Node: Program design43228
-Node: Multi-threaded decoding47153
-Ref: mt-extraction50434
-Node: Minimum archive sizes51740
-Node: Examples53867
-Node: Problems56234
-Node: Concept index56789
+Node: Introduction1281
+Node: Invoking tarlz4106
+Ref: --data-size13109
+Ref: --bsolid17626
+Node: Argument syntax23539
+Node: Portable character set25314
+Node: File format25958
+Ref: key_crc3233001
+Ref: ustar-uid-gid36305
+Ref: ustar-mtime37112
+Node: Amendments to pax format39115
+Ref: crc3239823
+Ref: flawed-compat41134
+Node: Program design45211
+Node: Multi-threaded decoding49138
+Ref: mt-extraction52407
+Node: Minimum archive sizes53713
+Node: Examples55840
+Node: Problems58199
+Node: Concept index58754

End Tag Table