316
322
Currently, most tar implementations comply with the ustar
317
323
format, occasionally extending it by adding new fields to the
318
324
blank area at the end of the header record.
325
.Ss Numeric Extensions
326
There have been several attempts to extend the range of sizes
327
or times supported by modifying how numbers are stored in the
330
One obvious extension to increase the size of files is to
331
eliminate the terminating characters from the various
333
For example, the standard only allows the size field to contain
334
11 octal digits, reserving the twelfth byte for a trailing
336
Allowing 12 octal digits allows file sizes up to 64 GB.
338
Another extension, utilized by GNU tar, star, and other newer
340
implementations, permits binary numbers in the standard numeric fields.
341
This is flagged by setting the high bit of the first byte.
342
The remainder of the field is treated as a signed twos-complement
344
This permits 95-bit values for the length and time fields
345
and 63-bit values for the uid, gid, and device numbers.
346
In particular, this provides a consistent way to handle
347
negative time values.
348
GNU tar supports this extension for the
349
length, mtime, ctime, and atime fields.
350
Joerg Schilling's star program and the libarchive library support
351
this extension for all numeric fields.
352
Note that this extension is largely obsoleted by the extended
353
attribute record provided by the pax interchange format.
355
Another early GNU extension allowed base-64 values rather than octal.
356
This extension was short-lived and is no longer supported by any
319
358
.Ss Pax Interchange Format
320
359
There are many attributes that cannot be portably stored in a
321
360
POSIX ustar archive.
359
398
.It Cm atime , Cm ctime , Cm mtime
360
399
File access, inode change, and modification times.
361
400
These fields can be negative or include a decimal point and a fractional value.
402
The character set used by the pax extension values.
403
By default, all textual values in the pax extended attributes
404
are assumed to be in UTF-8, including pathnames, user names,
406
In some cases, it is not possible to translate local
407
conventions into UTF-8.
408
If this key is present and the value is the six-character ASCII string
410
then all textual values are assumed to be in a platform-dependent
412
Note that there are only two valid values for this key:
415
.Dq ISO-IR\ 10646\ 2000\ UTF-8 .
416
No other values are permitted by the standard, and
417
the latter value should generally not be used as it is the
418
default when this key is not specified.
419
In particular, this flag should not be used as a general
420
mechanism to allow filenames to be stored in arbitrary
362
422
.It Cm uname , Cm uid , Cm gname , Cm gid
363
423
User name, group name, and numeric UID and GID values.
364
424
The user name and group name stored here are encoded in UTF8
741
814
XXX More details needed XXX
816
AIX Tar uses a ustar-formatted header with the type
818
for storing coded ACL information.
819
Unlike the Solaris format, AIX tar writes this header after the
820
regular file body to which it applies.
821
The pathname in this header is either
825
to indicate the type of ACL stored.
826
The actual ACL is stored in platform-specific binary format.
743
828
The tar distributed with Apple's Mac OS X stores most regular files
744
as two separate entries in the tar archive.
745
The two entries have the same name except that the first
829
as two separate files in the tar archive.
830
The two files have the same name except that the first
748
added to the beginning of the name.
749
This first entry stores the
751
with additional attributes for the file.
754
API is used to separate a file on disk into separate
755
resource and data streams and to reassemble those separate
756
streams when the file is restored to disk.
758
One obvious extension to increase the size of files is to
759
eliminate the terminating characters from the various
761
For example, the standard only allows the size field to contain
762
11 octal digits, reserving the twelfth byte for a trailing
764
Allowing 12 octal digits allows file sizes up to 64 GB.
766
Another extension, utilized by GNU tar, star, and other newer
768
implementations, permits binary numbers in the standard numeric fields.
769
This is flagged by setting the high bit of the first byte.
770
This permits 95-bit values for the length and time fields
771
and 63-bit values for the uid, gid, and device numbers.
772
GNU tar supports this extension for the
773
length, mtime, ctime, and atime fields.
774
Joerg Schilling's star program supports this extension for
776
Note that this extension is largely obsoleted by the extended attribute
777
record provided by the pax interchange format.
779
Another early GNU extension allowed base-64 values rather than octal.
780
This extension was short-lived and is no longer supported by any
833
prepended to the last path element.
834
This special file stores an AppleDouble-encoded
835
binary blob with additional metadata about the second file,
836
including ACL, extended attributes, and resources.
837
To recreate the original file on disk, each
838
separate file can be extracted and the Mac OS X
840
function can be used to unpack the separate
841
metadata file and apply it to th regular file.
842
Conversely, the same function provides a
844
option to encode the extended metadata from
845
a file into a separate file whose contents
846
can then be put into a tar archive.
848
Note that the Apple extended attributes interact
849
badly with long filenames.
850
Since each file is stored with the full name,
851
a separate set of extensions needs to be included
852
in the archive for each one, doubling the overhead
853
required for files with long names.
854
.Ss Summary of tar type codes
855
The following list is a condensed summary of the type codes
856
used in tar header records generated by different tar implementations.
857
More details about specific implementations can be found above:
858
.Bl -tag -compact -width XXX
860
Early tar programs stored a zero byte for regular files.
862
POSIX standard type code for a regular file.
864
POSIX standard type code for a hard link description.
866
POSIX standard type code for a symbolic link description.
868
POSIX standard type code for a character device node.
870
POSIX standard type code for a block device node.
872
POSIX standard type code for a directory.
874
POSIX standard type code for a FIFO.
878
GNU tar used for pre-allocated files on some systems.
880
Solaris tar ACL description stored prior to a regular file header.
882
AIX tar ACL description stored after the file body.
884
GNU tar directory dump.
886
GNU tar long linkname for the following header.
888
GNU tar long pathname for the following header.
890
GNU tar multivolume marker, indicating the file is a continuation of a file from the previous volume.
892
GNU tar long filename support. Deprecated.
894
GNU tar sparse regular file.
896
GNU tar tape/volume header name.
898
Solaris tar general-purpose extension header.
900
POSIX pax interchange format global extensions.
902
POSIX pax interchange format per-file extensions.