.ar File Extension
.ar file is, how to inspect Unix ar archives, how Poly supports them, and when to use TAR, ZIP, or another format. File extension details for .ar
Storage Only| File type | Unix ar archive |
|---|---|
| MIME type | |
| Encoding | Binary archive with fixed-width ASCII member headers |
| Operating systems | Linux, macOS, Windows, Unix |
| Opens with | GNU ar, LLVM llvm-ar, BSD ar |
| Poly support | Yes. Poly safely stores, syncs, shares, versions, and downloads .ar files. |
| Indexed by Poly | Partial. Poly indexes the filename and ordinary file properties, not archive members or symbols. |
| Preview in Poly | No. Download the file to inspect it with an ar-compatible tool. |
| Poly agent | No. The Poly agent cannot read members packed inside an .ar file. |
What kind of file is an .ar?
An .ar file is usually a Unix ar archive, a container that stores a sequence of files called members. Compiler toolchains commonly use ar containers for static libraries, although those libraries usually have the .a extension. An .ar archive can hold any kind of file and normally does not compress its members.1
Most conventional ar files start with the eight ASCII bytes !<arch>\n, or 21 3C 61 72 63 68 3E 0A in hexadecimal. Each member then has a fixed-width ASCII header followed by its binary or text payload.2 GNU thin archives instead start with !<thin>\n and refer to files elsewhere rather than embedding their contents.1
The de facto MIME type is application/x-unix-archive. It is not registered by IANA, and some software uses application/x-archive instead.34
.ar does not convert its structure. Check the signature and let an archive tool validate the members.How do I open an .ar on my computer?
An .ar file is meant for an archive utility or development tool, not a document viewer.
- On Linux and other Unix systems, use GNU
aror the system's BSD-compatiblear. - On macOS, use
arfrom Apple's command-line developer tools. - On Windows, use LLVM's cross-platform
llvm-aror a Unix-compatible development environment.
List members without extracting them:
ar t package.ar
ar tv package.ar
LLVM documents readers for SVR4, GNU, BSD, AIX big, and Darwin archives.5 This matters because ar variants share an outer family but differ in details such as long filenames and symbol tables.
Extract an unfamiliar archive only into a new directory after reviewing its member list. Treat embedded object files and executables as untrusted software. GNU also notes that thin archives cannot be extracted because their member data lives in separate files.6
Poly support for .ar
Poly recognizes .ar as an archive. It stores, syncs, shares, versions, downloads, and finds the outer file by name and ordinary file properties.
Poly does not open an archive browser, extract members, index member names or symbols, or make packed contents available to the Poly agent. Download the file and inspect it with a trusted ar-compatible tool. The related .a suffix can also be stored, but Poly does not currently infer the ar media type from that filename alone.
History of .ar
The ar command and archive format appeared in the first edition of the Unix Programmer's Manual, dated November 3, 1971.7 The name is short for “archive.” The .ar suffix makes the container explicit, while .a became the stronger convention for static libraries.
Ar remains useful because a static library can include a symbol index that helps a linker locate needed members efficiently. Modern implementations also support deterministic archives, replacing variable ownership and timestamp fields so identical inputs can produce repeatable output.5
Working with .ar and alternatives
Choose a container that matches the recipient's tooling:
| Need | Better choice |
|---|---|
| Build or inspect a static library | ar with the expected toolchain variant |
| Preserve a directory tree and Unix metadata | TAR |
| Share a compressed archive broadly | ZIP |
| Work with a Debian package | dpkg-deb, not raw ar |
A Debian package with the .deb suffix is itself an ar archive with required members such as debian-binary, control.tar, and data.tar.8 Use the package-aware tool because raw ar understands only the outer container.
Converting an ordinary .ar means extracting its members and creating a different archive. Repacking a static library as TAR or ZIP stops it from being linkable, and repacking does not make object code compatible with another CPU, ABI, or operating system. Rebuild from source when target compatibility matters.
Footnotes
- GNU Binutils. ar. The manual describes archive members, symbol indexes, and ordinary and thin archives. ↩ ↩2
- LLVM Project. llvm-ar File Format. The format description specifies the eight-byte signature and fixed-width member header. ↩
- Internet Assigned Numbers Authority. Media Types Registry. The registry does not list
application/x-unix-archiveorapplication/x-archive. ↩ - Apache Tika. Core MIME Type Definitions. Tika associates
.arwith the ar family and treatsapplication/x-unix-archiveas an alias. ↩ - LLVM Project. llvm-ar Command Guide. The guide documents supported variants, symbol tables, and deterministic archives. ↩ ↩2
- GNU Binutils. Controlling ar on the Command Line. The extraction documentation covers thin archives and path restrictions. ↩
- Nokia Bell Labs. Unix Programmer's Manual, First Edition. The surviving manual is dated November 3, 1971 and documents
ar. ↩ - Debian. deb(5): Debian Binary Package Format. The format specifies an ar container and its required members. ↩