请输入您要查询的百科知识:

 

词条 Xar (archiver)
释义

  1. File structure

      Header    Table of contents  

  2. References

  3. External links

{{lowercase}}{{Infobox file format
| name = XAR
| icon =
| logo =
| screenshot =
| caption =
|_noextcode = on
| extensions = {{code|.xar}}, {{code|.pkg}}, {{code|.xip}}[1]
| mime = application/x-xar[1]
| type code =
| uniform type = com.apple.xar-archive
| magic = xar!
| owner =
| released =
| latest release version = 1.6.1
| latest release date = {{Start date and age|2012|09|17|df=yes}}
| genre = archive file format
| container for =
| contained by =
| extended from = XML, gzip
| extended to =
| standard =
| free =
| url = {{URL|https://mackyle.github.io/xar/}} {{URL|https://github.com/mackyle/xar}}
}}XAR (short for eXtensible ARchive format) is an open source file archiver and the archiver’s file format. It was created within the OpenDarwin project and is used in macOS X 10.5 and up for software installation routines, as well as browser extensions in Safari 5.0 and up. Xar replaced the use of gzipped pax files.[2]

One development branch of RPM, RPM5, uses xar.[3]

File structure

The file consists of three sections, the header, the table of contents and the heap. All fields are stored in big endian order.[4]

Header

Offset# Size
(in bytes)
Purpose
0 4 File signature used to identify the file format as Xar.
This should always equal xar!
4 2 Header size
6 2 Version of Xar format to use.
Currently there is only version 1.
88Length of the TOC compressed data.
168Length of the TOC uncompressed data.
244Checksum algorithm:{{plainlist}}
  • 0 = none
  • 1 = SHA1
  • 2 = MD5
  • 3 = SHA-256[5]
  • 4 = SHA-512
{{endplainlist}}
280, 4 , 36sometimes padding bytes or checksum algorithm name

Table of contents

Xar is different from cpio, tar or ar in that it stores the TOC (table of contents) in the beginning of the file, making appending to an archive more complicated, but making it unnecessary to scan through the archive to extract an individual contained file. The table of contents is stored as a zlib compressed, UTF-8 encoded, XML document.[6][4] Each file that is stored in the Xar is independently compressed/encoded. This gives the ability to have the file(s) encoded using gzip while having another file in the same archive encoded using a different method such as bzip2. On some systems the archive member can also be encoded by xz or lzma compression method.[5]

Example Table of contents020staff20joe5010755directorycom.foobar205010775directoryContents428201005a5f6f1461213a904f831d4ef6f214638342842ed21d21a0c90378248ce0dfb6f345376d1b00d65fc205010664fileInfo.plist205010775directoryResources14868448274432efe5c97921de7ccc5aebc158d158e9d4280d681445c8be42d1d9afdb57ddd5e9311453010ec46161205010664filefoobar1763515316450563c761ffcc81ee6e232e4f4a1c4a81654c26c4e520ea31f8ef0e5987a1838a64ab5c26ebf3ee4bc37205010664filedocSet.skidx205010775directoryDocuments35790329512092425242cd71585c34e722932f324706f8c00e1ae0c5c0e013e53d829511835e2b429abb5198731e9a3e205010664filefoobar.html

References

1. ^{{cite web|url=https://reposcope.com/mimetype/application/x-xar|language=en|title=application/x-xar|accessdate=2019-03-19}}
2. ^Nabble – xar in Mac OS X {{webarchive |url=https://web.archive.org/web/20070207045420/http://www.nabble.com/xar-in-Mac-OS-X-t2081148.html |date=February 7, 2007 }}
3. ^RPM 5 package manager
4. ^https://github.com/mackyle/xar/wiki/xarformat
5. ^{{cite web|url=https://www.unix.com/man-page/mojave/1/xar|title=xar - eXtensible ARchiver mojave man page|accessdate=2019-03-26|last1=Braun|first1=Rob|last2=Fuller|first2=Landon|last3=Leimbach|first3=David|last4=Van Vechten|first4=Kevin|date=2015-06-04}}
6. ^https://code.google.com/archive/p/xar/wikis/xarformat.wiki

External links

{{Portal|Free and open-source software}}
  • Xar homepage
  • [https://opensource.apple.com/source/xar/ Apple xar homepage]
{{Archive formats}}{{DEFAULTSORT:Xar (Archiver)}}{{storage-software-stub}}

1 : Archive formats

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/12 10:49:33