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!
===Random access=== The tar format was designed without a centralized index or table of content for files and their properties for streaming to tape backup devices. Instead, the metadata for each file (such as name, size, time stamps) for each file is stored in a header before each file. The archive must be read sequentially to list or extract files. For large tar archives, this causes a performance penalty, making tar archives unsuitable for situations that often require random access to individual files. In turn, this design makes TAR archives resilient against damage from missing portions, in both the form of digital files and physical tape.{{cn|date=February 2025}} A truncated TAR file with missing parts on either ends still allows recovering the parts that are not missing, including the file paths and file names and metadata, by starting from the first TAR header that is not missing.<ref>Creating TAR with 100 KB missing at the beginning: <code>tail --bytes=+100000 "intact archive.tar" >>"missing beginning.tar"</code>. Next header can be found using a [[hex editor]]. Recover using <code>dd if="missing beginning.tar" of=recovered.tar ibs=''[bytes until next header which starts with file path and name]'' skip=1</code>. Quotation marks are not needed for file names without spaces.</ref> With a well-formed tar file stored on a seekable (i.e. allows efficient random reads) medium, the {{code|tar}} program can still relatively quickly (in linear time relative to file count) look for a file by skipping file reads according to the "size" field in the file headers. This is the basis for option {{code|-n}} in GNU tar. When a tar file is compressed whole, the compression format, being usually non-seekable, prevents this optimization from being done.<ref>{{cite web |last1=BillThor |title=What makes a tar archive seekable? |url=https://superuser.com/a/1235409 |website=Super User |access-date=15 December 2023 |language=en |date=July 28, 2017}}</ref> To maintain seekability, tar files must be also concatenated properly, by removing the trailing zero block at the end of each file.<ref>{{cite web |title=GNU tar 1.35: 4.2.4 Combining Archives with --concatenate |url=https://www.gnu.org/software/tar/manual/html_node/concatenate.html |website=www.gnu.org}}</ref>
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