Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Tar (computing)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Header=== The file header record contains [[metadata]] about a file. To ensure portability across different architectures with different [[Endianness|byte orderings]], the information in the header record is encoded in [[ASCII]]. Thus if all the files in an archive are ASCII text files, and have ASCII names, then the archive is essentially an ASCII text file (containing many [[Null character|NUL characters]]). The fields defined by the original Unix tar format are listed in the table below. The link indicator/file type table includes some modern extensions. When a field is unused it is filled with NUL bytes. The header uses 257 bytes, then is padded with NUL bytes to make it fill a 512 byte record. There is no "magic number" in the header, for file identification. Pre-POSIX.1-1988 (i.e. v7) tar header: {| class="wikitable" |- ! Field offset ! Field size ! Field |- | 0 | 100 | File path and name |- | 100 | 8 | File mode (octal) |- | 108 | 8 | Owner's numeric user ID (octal) |- | 116 | 8 | Group's numeric user ID (octal) |- | 124 | 12 | File size in bytes (octal) |- | 136 | 12 | Last modification time in numeric Unix time format (octal) |- | 148 | 8 | Checksum for header record |- | 156 | 1 | Link indicator (file type) |- | 157 | 100 | Name of linked file |} The pre-POSIX.1-1988 '''Link indicator''' field can have the following values: {| class="wikitable" |+ Link indicator field |- ! Value ! Meaning |- | '0' or ([[ASCII]] [[Null character|NUL]]) | Normal file |- | '1' | [[Hard link]] |- | '2' | [[Symbolic link]] |} Some pre-POSIX.1-1988 tar implementations indicated a directory by having a trailing [[Slash (punctuation)|slash]] (/) in the name. Numeric values are encoded in [[octal]] numbers using ASCII digits, with leading zeroes. For historical reasons, a final NUL or [[Space (punctuation)|space]] character should also be used. Thus although there are 12 bytes reserved for storing the file size, only 11 octal digits can be stored. This gives a maximum file size of 8 [[gigabyte]]s on archived files. To overcome this limitation, in 2001 star introduced a base-256 coding that is indicated by setting the high-order bit of the leftmost byte of a numeric field.{{cn|date=October 2021}} GNU-tar and BSD-tar followed this idea. Additionally, versions of tar from before the first POSIX standard from 1988 pad the values with spaces instead of zeroes. The [[checksum]] is calculated by taking the sum of the unsigned byte values of the header record with the eight checksum bytes taken to be ASCII spaces (decimal value 32). It is stored as a six digit octal number with leading zeroes followed by a NUL and then a space. Various implementations do not adhere to this format. In addition, some historic tar implementations treated bytes as signed. Implementations typically calculate the checksum both ways, and treat it as good if either the signed or unsigned sum matches the included checksum. Unix filesystems support multiple links (names) for the same file. If several such files appear in a tar archive, only the first one is archived as a normal file; the rest are archived as hard links, with the "name of linked file" field set to the first one's name. On extraction, such hard links should be recreated in the file system.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Tar (computing)
(section)
Add topic