Import libarchive-2.8.4.
[dragonfly.git] / contrib / libarchive / libarchive / tar.5
... / ...
CommitLineData
1.\" Copyright (c) 2003-2009 Tim Kientzle
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: head/lib/libarchive/tar.5 201077 2009-12-28 01:50:23Z kientzle $
26.\"
27.Dd December 27, 2009
28.Dt tar 5
29.Os
30.Sh NAME
31.Nm tar
32.Nd format of tape archive files
33.Sh DESCRIPTION
34The
35.Nm
36archive format collects any number of files, directories, and other
37file system objects (symbolic links, device nodes, etc.) into a single
38stream of bytes.
39The format was originally designed to be used with
40tape drives that operate with fixed-size blocks, but is widely used as
41a general packaging mechanism.
42.Ss General Format
43A
44.Nm
45archive consists of a series of 512-byte records.
46Each file system object requires a header record which stores basic metadata
47(pathname, owner, permissions, etc.) and zero or more records containing any
48file data.
49The end of the archive is indicated by two records consisting
50entirely of zero bytes.
51.Pp
52For compatibility with tape drives that use fixed block sizes,
53programs that read or write tar files always read or write a fixed
54number of records with each I/O operation.
55These
56.Dq blocks
57are always a multiple of the record size.
58The maximum block size supported by early
59implementations was 10240 bytes or 20 records.
60This is still the default for most implementations
61although block sizes of 1MiB (2048 records) or larger are
62commonly used with modern high-speed tape drives.
63(Note: the terms
64.Dq block
65and
66.Dq record
67here are not entirely standard; this document follows the
68convention established by John Gilmore in documenting
69.Nm pdtar . )
70.Ss Old-Style Archive Format
71The original tar archive format has been extended many times to
72include additional information that various implementors found
73necessary.
74This section describes the variant implemented by the tar command
75included in
76.At v7 ,
77which seems to be the earliest widely-used version of the tar program.
78.Pp
79The header record for an old-style
80.Nm
81archive consists of the following:
82.Bd -literal -offset indent
83struct header_old_tar {
84 char name[100];
85 char mode[8];
86 char uid[8];
87 char gid[8];
88 char size[12];
89 char mtime[12];
90 char checksum[8];
91 char linkflag[1];
92 char linkname[100];
93 char pad[255];
94};
95.Ed
96All unused bytes in the header record are filled with nulls.
97.Bl -tag -width indent
98.It Va name
99Pathname, stored as a null-terminated string.
100Early tar implementations only stored regular files (including
101hardlinks to those files).
102One common early convention used a trailing "/" character to indicate
103a directory name, allowing directory permissions and owner information
104to be archived and restored.
105.It Va mode
106File mode, stored as an octal number in ASCII.
107.It Va uid , Va gid
108User id and group id of owner, as octal numbers in ASCII.
109.It Va size
110Size of file, as octal number in ASCII.
111For regular files only, this indicates the amount of data
112that follows the header.
113In particular, this field was ignored by early tar implementations
114when extracting hardlinks.
115Modern writers should always store a zero length for hardlink entries.
116.It Va mtime
117Modification time of file, as an octal number in ASCII.
118This indicates the number of seconds since the start of the epoch,
11900:00:00 UTC January 1, 1970.
120Note that negative values should be avoided
121here, as they are handled inconsistently.
122.It Va checksum
123Header checksum, stored as an octal number in ASCII.
124To compute the checksum, set the checksum field to all spaces,
125then sum all bytes in the header using unsigned arithmetic.
126This field should be stored as six octal digits followed by a null and a space
127character.
128Note that many early implementations of tar used signed arithmetic
129for the checksum field, which can cause interoperability problems
130when transferring archives between systems.
131Modern robust readers compute the checksum both ways and accept the
132header if either computation matches.
133.It Va linkflag , Va linkname
134In order to preserve hardlinks and conserve tape, a file
135with multiple links is only written to the archive the first
136time it is encountered.
137The next time it is encountered, the
138.Va linkflag
139is set to an ASCII
140.Sq 1
141and the
142.Va linkname
143field holds the first name under which this file appears.
144(Note that regular files have a null value in the
145.Va linkflag
146field.)
147.El
148.Pp
149Early tar implementations varied in how they terminated these fields.
150The tar command in
151.At v7
152used the following conventions (this is also documented in early BSD manpages):
153the pathname must be null-terminated;
154the mode, uid, and gid fields must end in a space and a null byte;
155the size and mtime fields must end in a space;
156the checksum is terminated by a null and a space.
157Early implementations filled the numeric fields with leading spaces.
158This seems to have been common practice until the
159.St -p1003.1-88
160standard was released.
161For best portability, modern implementations should fill the numeric
162fields with leading zeros.
163.Ss Pre-POSIX Archives
164An early draft of
165.St -p1003.1-88
166served as the basis for John Gilmore's
167.Nm pdtar
168program and many system implementations from the late 1980s
169and early 1990s.
170These archives generally follow the POSIX ustar
171format described below with the following variations:
172.Bl -bullet -compact -width indent
173.It
174The magic value is
175.Dq ustar\ \&
176(note the following space).
177The version field contains a space character followed by a null.
178.It
179The numeric fields are generally filled with leading spaces
180(not leading zeros as recommended in the final standard).
181.It
182The prefix field is often not used, limiting pathnames to
183the 100 characters of old-style archives.
184.El
185.Ss POSIX ustar Archives
186.St -p1003.1-88
187defined a standard tar file format to be read and written
188by compliant implementations of
189.Xr tar 1 .
190This format is often called the
191.Dq ustar
192format, after the magic value used
193in the header.
194(The name is an acronym for
195.Dq Unix Standard TAR . )
196It extends the historic format with new fields:
197.Bd -literal -offset indent
198struct header_posix_ustar {
199 char name[100];
200 char mode[8];
201 char uid[8];
202 char gid[8];
203 char size[12];
204 char mtime[12];
205 char checksum[8];
206 char typeflag[1];
207 char linkname[100];
208 char magic[6];
209 char version[2];
210 char uname[32];
211 char gname[32];
212 char devmajor[8];
213 char devminor[8];
214 char prefix[155];
215 char pad[12];
216};
217.Ed
218.Bl -tag -width indent
219.It Va typeflag
220Type of entry.
221POSIX extended the earlier
222.Va linkflag
223field with several new type values:
224.Bl -tag -width indent -compact
225.It Dq 0
226Regular file.
227NUL should be treated as a synonym, for compatibility purposes.
228.It Dq 1
229Hard link.
230.It Dq 2
231Symbolic link.
232.It Dq 3
233Character device node.
234.It Dq 4
235Block device node.
236.It Dq 5
237Directory.
238.It Dq 6
239FIFO node.
240.It Dq 7
241Reserved.
242.It Other
243A POSIX-compliant implementation must treat any unrecognized typeflag value
244as a regular file.
245In particular, writers should ensure that all entries
246have a valid filename so that they can be restored by readers that do not
247support the corresponding extension.
248Uppercase letters "A" through "Z" are reserved for custom extensions.
249Note that sockets and whiteout entries are not archivable.
250.El
251It is worth noting that the
252.Va size
253field, in particular, has different meanings depending on the type.
254For regular files, of course, it indicates the amount of data
255following the header.
256For directories, it may be used to indicate the total size of all
257files in the directory, for use by operating systems that pre-allocate
258directory space.
259For all other types, it should be set to zero by writers and ignored
260by readers.
261.It Va magic
262Contains the magic value
263.Dq ustar
264followed by a NUL byte to indicate that this is a POSIX standard archive.
265Full compliance requires the uname and gname fields be properly set.
266.It Va version
267Version.
268This should be
269.Dq 00
270(two copies of the ASCII digit zero) for POSIX standard archives.
271.It Va uname , Va gname
272User and group names, as null-terminated ASCII strings.
273These should be used in preference to the uid/gid values
274when they are set and the corresponding names exist on
275the system.
276.It Va devmajor , Va devminor
277Major and minor numbers for character device or block device entry.
278.It Va name , Va prefix
279If the pathname is too long to fit in the 100 bytes provided by the standard
280format, it can be split at any
281.Pa /
282character with the first portion going into the prefix field.
283If the prefix field is not empty, the reader will prepend
284the prefix value and a
285.Pa /
286character to the regular name field to obtain the full pathname.
287The standard does not require a trailing
288.Pa /
289character on directory names, though most implementations still
290include this for compatibility reasons.
291.El
292.Pp
293Note that all unused bytes must be set to
294.Dv NUL .
295.Pp
296Field termination is specified slightly differently by POSIX
297than by previous implementations.
298The
299.Va magic ,
300.Va uname ,
301and
302.Va gname
303fields must have a trailing
304.Dv NUL .
305The
306.Va pathname ,
307.Va linkname ,
308and
309.Va prefix
310fields must have a trailing
311.Dv NUL
312unless they fill the entire field.
313(In particular, it is possible to store a 256-character pathname if it
314happens to have a
315.Pa /
316as the 156th character.)
317POSIX requires numeric fields to be zero-padded in the front, and requires
318them to be terminated with either space or
319.Dv NUL
320characters.
321.Pp
322Currently, most tar implementations comply with the ustar
323format, occasionally extending it by adding new fields to the
324blank area at the end of the header record.
325.Ss Pax Interchange Format
326There are many attributes that cannot be portably stored in a
327POSIX ustar archive.
328.St -p1003.1-2001
329defined a
330.Dq pax interchange format
331that uses two new types of entries to hold text-formatted
332metadata that applies to following entries.
333Note that a pax interchange format archive is a ustar archive in every
334respect.
335The new data is stored in ustar-compatible archive entries that use the
336.Dq x
337or
338.Dq g
339typeflag.
340In particular, older implementations that do not fully support these
341extensions will extract the metadata into regular files, where the
342metadata can be examined as necessary.
343.Pp
344An entry in a pax interchange format archive consists of one or
345two standard ustar entries, each with its own header and data.
346The first optional entry stores the extended attributes
347for the following entry.
348This optional first entry has an "x" typeflag and a size field that
349indicates the total size of the extended attributes.
350The extended attributes themselves are stored as a series of text-format
351lines encoded in the portable UTF-8 encoding.
352Each line consists of a decimal number, a space, a key string, an equals
353sign, a value string, and a new line.
354The decimal number indicates the length of the entire line, including the
355initial length field and the trailing newline.
356An example of such a field is:
357.Dl 25 ctime=1084839148.1212\en
358Keys in all lowercase are standard keys.
359Vendors can add their own keys by prefixing them with an all uppercase
360vendor name and a period.
361Note that, unlike the historic header, numeric values are stored using
362decimal, not octal.
363A description of some common keys follows:
364.Bl -tag -width indent
365.It Cm atime , Cm ctime , Cm mtime
366File access, inode change, and modification times.
367These fields can be negative or include a decimal point and a fractional value.
368.It Cm uname , Cm uid , Cm gname , Cm gid
369User name, group name, and numeric UID and GID values.
370The user name and group name stored here are encoded in UTF8
371and can thus include non-ASCII characters.
372The UID and GID fields can be of arbitrary length.
373.It Cm linkpath
374The full path of the linked-to file.
375Note that this is encoded in UTF8 and can thus include non-ASCII characters.
376.It Cm path
377The full pathname of the entry.
378Note that this is encoded in UTF8 and can thus include non-ASCII characters.
379.It Cm realtime.* , Cm security.*
380These keys are reserved and may be used for future standardization.
381.It Cm size
382The size of the file.
383Note that there is no length limit on this field, allowing conforming
384archives to store files much larger than the historic 8GB limit.
385.It Cm SCHILY.*
386Vendor-specific attributes used by Joerg Schilling's
387.Nm star
388implementation.
389.It Cm SCHILY.acl.access , Cm SCHILY.acl.default
390Stores the access and default ACLs as textual strings in a format
391that is an extension of the format specified by POSIX.1e draft 17.
392In particular, each user or group access specification can include a fourth
393colon-separated field with the numeric UID or GID.
394This allows ACLs to be restored on systems that may not have complete
395user or group information available (such as when NIS/YP or LDAP services
396are temporarily unavailable).
397.It Cm SCHILY.devminor , Cm SCHILY.devmajor
398The full minor and major numbers for device nodes.
399.It Cm SCHILY.fflags
400The file flags.
401.It Cm SCHILY.realsize
402The full size of the file on disk.
403XXX explain? XXX
404.It Cm SCHILY.dev, Cm SCHILY.ino , Cm SCHILY.nlinks
405The device number, inode number, and link count for the entry.
406In particular, note that a pax interchange format archive using Joerg
407Schilling's
408.Cm SCHILY.*
409extensions can store all of the data from
410.Va struct stat .
411.It Cm LIBARCHIVE.xattr. Ns Ar namespace Ns . Ns Ar key
412Libarchive stores POSIX.1e-style extended attributes using
413keys of this form.
414The
415.Ar key
416value is URL-encoded:
417All non-ASCII characters and the two special characters
418.Dq =
419and
420.Dq %
421are encoded as
422.Dq %
423followed by two uppercase hexadecimal digits.
424The value of this key is the extended attribute value
425encoded in base 64.
426XXX Detail the base-64 format here XXX
427.It Cm VENDOR.*
428XXX document other vendor-specific extensions XXX
429.El
430.Pp
431Any values stored in an extended attribute override the corresponding
432values in the regular tar header.
433Note that compliant readers should ignore the regular fields when they
434are overridden.
435This is important, as existing archivers are known to store non-compliant
436values in the standard header fields in this situation.
437There are no limits on length for any of these fields.
438In particular, numeric fields can be arbitrarily large.
439All text fields are encoded in UTF8.
440Compliant writers should store only portable 7-bit ASCII characters in
441the standard ustar header and use extended
442attributes whenever a text value contains non-ASCII characters.
443.Pp
444In addition to the
445.Cm x
446entry described above, the pax interchange format
447also supports a
448.Cm g
449entry.
450The
451.Cm g
452entry is identical in format, but specifies attributes that serve as
453defaults for all subsequent archive entries.
454The
455.Cm g
456entry is not widely used.
457.Pp
458Besides the new
459.Cm x
460and
461.Cm g
462entries, the pax interchange format has a few other minor variations
463from the earlier ustar format.
464The most troubling one is that hardlinks are permitted to have
465data following them.
466This allows readers to restore any hardlink to a file without
467having to rewind the archive to find an earlier entry.
468However, it creates complications for robust readers, as it is no longer
469clear whether or not they should ignore the size field for hardlink entries.
470.Ss GNU Tar Archives
471The GNU tar program started with a pre-POSIX format similar to that
472described earlier and has extended it using several different mechanisms:
473It added new fields to the empty space in the header (some of which was later
474used by POSIX for conflicting purposes);
475it allowed the header to be continued over multiple records;
476and it defined new entries that modify following entries
477(similar in principle to the
478.Cm x
479entry described above, but each GNU special entry is single-purpose,
480unlike the general-purpose
481.Cm x
482entry).
483As a result, GNU tar archives are not POSIX compatible, although
484more lenient POSIX-compliant readers can successfully extract most
485GNU tar archives.
486.Bd -literal -offset indent
487struct header_gnu_tar {
488 char name[100];
489 char mode[8];
490 char uid[8];
491 char gid[8];
492 char size[12];
493 char mtime[12];
494 char checksum[8];
495 char typeflag[1];
496 char linkname[100];
497 char magic[6];
498 char version[2];
499 char uname[32];
500 char gname[32];
501 char devmajor[8];
502 char devminor[8];
503 char atime[12];
504 char ctime[12];
505 char offset[12];
506 char longnames[4];
507 char unused[1];
508 struct {
509 char offset[12];
510 char numbytes[12];
511 } sparse[4];
512 char isextended[1];
513 char realsize[12];
514 char pad[17];
515};
516.Ed
517.Bl -tag -width indent
518.It Va typeflag
519GNU tar uses the following special entry types, in addition to
520those defined by POSIX:
521.Bl -tag -width indent
522.It "7"
523GNU tar treats type "7" records identically to type "0" records,
524except on one obscure RTOS where they are used to indicate the
525pre-allocation of a contiguous file on disk.
526.It "D"
527This indicates a directory entry.
528Unlike the POSIX-standard "5"
529typeflag, the header is followed by data records listing the names
530of files in this directory.
531Each name is preceded by an ASCII "Y"
532if the file is stored in this archive or "N" if the file is not
533stored in this archive.
534Each name is terminated with a null, and
535an extra null marks the end of the name list.
536The purpose of this
537entry is to support incremental backups; a program restoring from
538such an archive may wish to delete files on disk that did not exist
539in the directory when the archive was made.
540.Pp
541Note that the "D" typeflag specifically violates POSIX, which requires
542that unrecognized typeflags be restored as normal files.
543In this case, restoring the "D" entry as a file could interfere
544with subsequent creation of the like-named directory.
545.It "K"
546The data for this entry is a long linkname for the following regular entry.
547.It "L"
548The data for this entry is a long pathname for the following regular entry.
549.It "M"
550This is a continuation of the last file on the previous volume.
551GNU multi-volume archives guarantee that each volume begins with a valid
552entry header.
553To ensure this, a file may be split, with part stored at the end of one volume,
554and part stored at the beginning of the next volume.
555The "M" typeflag indicates that this entry continues an existing file.
556Such entries can only occur as the first or second entry
557in an archive (the latter only if the first entry is a volume label).
558The
559.Va size
560field specifies the size of this entry.
561The
562.Va offset
563field at bytes 369-380 specifies the offset where this file fragment
564begins.
565The
566.Va realsize
567field specifies the total size of the file (which must equal
568.Va size
569plus
570.Va offset ) .
571When extracting, GNU tar checks that the header file name is the one it is
572expecting, that the header offset is in the correct sequence, and that
573the sum of offset and size is equal to realsize.
574.It "N"
575Type "N" records are no longer generated by GNU tar.
576They contained a
577list of files to be renamed or symlinked after extraction; this was
578originally used to support long names.
579The contents of this record
580are a text description of the operations to be done, in the form
581.Dq Rename %s to %s\en
582or
583.Dq Symlink %s to %s\en ;
584in either case, both
585filenames are escaped using K&R C syntax.
586Due to security concerns, "N" records are now generally ignored
587when reading archives.
588.It "S"
589This is a
590.Dq sparse
591regular file.
592Sparse files are stored as a series of fragments.
593The header contains a list of fragment offset/length pairs.
594If more than four such entries are required, the header is
595extended as necessary with
596.Dq extra
597header extensions (an older format that is no longer used), or
598.Dq sparse
599extensions.
600.It "V"
601The
602.Va name
603field should be interpreted as a tape/volume header name.
604This entry should generally be ignored on extraction.
605.El
606.It Va magic
607The magic field holds the five characters
608.Dq ustar
609followed by a space.
610Note that POSIX ustar archives have a trailing null.
611.It Va version
612The version field holds a space character followed by a null.
613Note that POSIX ustar archives use two copies of the ASCII digit
614.Dq 0 .
615.It Va atime , Va ctime
616The time the file was last accessed and the time of
617last change of file information, stored in octal as with
618.Va mtime .
619.It Va longnames
620This field is apparently no longer used.
621.It Sparse Va offset / Va numbytes
622Each such structure specifies a single fragment of a sparse
623file.
624The two fields store values as octal numbers.
625The fragments are each padded to a multiple of 512 bytes
626in the archive.
627On extraction, the list of fragments is collected from the
628header (including any extension headers), and the data
629is then read and written to the file at appropriate offsets.
630.It Va isextended
631If this is set to non-zero, the header will be followed by additional
632.Dq sparse header
633records.
634Each such record contains information about as many as 21 additional
635sparse blocks as shown here:
636.Bd -literal -offset indent
637struct gnu_sparse_header {
638 struct {
639 char offset[12];
640 char numbytes[12];
641 } sparse[21];
642 char isextended[1];
643 char padding[7];
644};
645.Ed
646.It Va realsize
647A binary representation of the file's complete size, with a much larger range
648than the POSIX file size.
649In particular, with
650.Cm M
651type files, the current entry is only a portion of the file.
652In that case, the POSIX size field will indicate the size of this
653entry; the
654.Va realsize
655field will indicate the total size of the file.
656.El
657.Ss GNU tar pax archives
658GNU tar 1.14 (XXX check this XXX) and later will write
659pax interchange format archives when you specify the
660.Fl -posix
661flag.
662This format uses custom keywords to store sparse file information.
663There have been three iterations of this support, referred to
664as
665.Dq 0.0 ,
666.Dq 0.1 ,
667and
668.Dq 1.0 .
669.Bl -tag -width indent
670.It Cm GNU.sparse.numblocks , Cm GNU.sparse.offset , Cm GNU.sparse.numbytes , Cm GNU.sparse.size
671The
672.Dq 0.0
673format used an initial
674.Cm GNU.sparse.numblocks
675attribute to indicate the number of blocks in the file, a pair of
676.Cm GNU.sparse.offset
677and
678.Cm GNU.sparse.numbytes
679to indicate the offset and size of each block,
680and a single
681.Cm GNU.sparse.size
682to indicate the full size of the file.
683This is not the same as the size in the tar header because the
684latter value does not include the size of any holes.
685This format required that the order of attributes be preserved and
686relied on readers accepting multiple appearances of the same attribute
687names, which is not officially permitted by the standards.
688.It Cm GNU.sparse.map
689The
690.Dq 0.1
691format used a single attribute that stored a comma-separated
692list of decimal numbers.
693Each pair of numbers indicated the offset and size, respectively,
694of a block of data.
695This does not work well if the archive is extracted by an archiver
696that does not recognize this extension, since many pax implementations
697simply discard unrecognized attributes.
698.It Cm GNU.sparse.major , Cm GNU.sparse.minor , Cm GNU.sparse.name , Cm GNU.sparse.realsize
699The
700.Dq 1.0
701format stores the sparse block map in one or more 512-byte blocks
702prepended to the file data in the entry body.
703The pax attributes indicate the existence of this map
704(via the
705.Cm GNU.sparse.major
706and
707.Cm GNU.sparse.minor
708fields)
709and the full size of the file.
710The
711.Cm GNU.sparse.name
712holds the true name of the file.
713To avoid confusion, the name stored in the regular tar header
714is a modified name so that extraction errors will be apparent
715to users.
716.El
717.Ss Solaris Tar
718XXX More Details Needed XXX
719.Pp
720Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an
721.Dq extended
722format that is fundamentally similar to pax interchange format,
723with the following differences:
724.Bl -bullet -compact -width indent
725.It
726Extended attributes are stored in an entry whose type is
727.Cm X ,
728not
729.Cm x ,
730as used by pax interchange format.
731The detailed format of this entry appears to be the same
732as detailed above for the
733.Cm x
734entry.
735.It
736An additional
737.Cm A
738entry is used to store an ACL for the following regular entry.
739The body of this entry contains a seven-digit octal number
740followed by a zero byte, followed by the
741textual ACL description.
742The octal value is the number of ACL entries
743plus a constant that indicates the ACL type: 01000000
744for POSIX.1e ACLs and 03000000 for NFSv4 ACLs.
745.El
746.Ss AIX Tar
747XXX More details needed XXX
748.Ss Mac OS X Tar
749The tar distributed with Apple's Mac OS X stores most regular files
750as two separate entries in the tar archive.
751The two entries have the same name except that the first
752one has
753.Dq ._
754added to the beginning of the name.
755This first entry stores the
756.Dq resource fork
757with additional attributes for the file.
758The Mac OS X
759.Fn CopyFile
760API is used to separate a file on disk into separate
761resource and data streams and to reassemble those separate
762streams when the file is restored to disk.
763.Ss Other Extensions
764One obvious extension to increase the size of files is to
765eliminate the terminating characters from the various
766numeric fields.
767For example, the standard only allows the size field to contain
76811 octal digits, reserving the twelfth byte for a trailing
769NUL character.
770Allowing 12 octal digits allows file sizes up to 64 GB.
771.Pp
772Another extension, utilized by GNU tar, star, and other newer
773.Nm
774implementations, permits binary numbers in the standard numeric fields.
775This is flagged by setting the high bit of the first byte.
776This permits 95-bit values for the length and time fields
777and 63-bit values for the uid, gid, and device numbers.
778GNU tar supports this extension for the
779length, mtime, ctime, and atime fields.
780Joerg Schilling's star program supports this extension for
781all numeric fields.
782Note that this extension is largely obsoleted by the extended attribute
783record provided by the pax interchange format.
784.Pp
785Another early GNU extension allowed base-64 values rather than octal.
786This extension was short-lived and is no longer supported by any
787implementation.
788.Sh SEE ALSO
789.Xr ar 1 ,
790.Xr pax 1 ,
791.Xr tar 1
792.Sh STANDARDS
793The
794.Nm tar
795utility is no longer a part of POSIX or the Single Unix Standard.
796It last appeared in
797.St -susv2 .
798It has been supplanted in subsequent standards by
799.Xr pax 1 .
800The ustar format is currently part of the specification for the
801.Xr pax 1
802utility.
803The pax interchange file format is new with
804.St -p1003.1-2001 .
805.Sh HISTORY
806A
807.Nm tar
808command appeared in Seventh Edition Unix, which was released in January, 1979.
809It replaced the
810.Nm tp
811program from Fourth Edition Unix which in turn replaced the
812.Nm tap
813program from First Edition Unix.
814John Gilmore's
815.Nm pdtar
816public-domain implementation (circa 1987) was highly influential
817and formed the basis of
818.Nm GNU tar
819(circa 1988).
820Joerg Shilling's
821.Nm star
822archiver is another open-source (GPL) archiver (originally developed
823circa 1985) which features complete support for pax interchange
824format.
825.Pp
826This documentation was written as part of the
827.Nm libarchive
828and
829.Nm bsdtar
830project by
831.An Tim Kientzle Aq kientzle@FreeBSD.org .