I need to access an ar created file, but I cannot find a specification document defining the format. Can someone point me in the right direction?
From Wikipedia:
The ar format has never been standardized; modern archives are based on a common format with two known variants, BSD and GNU.
More information is there, too.
Where to find information
It seems that GNU binutils does not have documentation for the file format.
I believe the best reference out there is in the ar(5) manual page from FreeBSD. The ar
utility was removed in version 5.0 but the manpage for 4.11 is still available.
As usual, the header details can be found in the header files:
- GNU Binutils - ar.h
- FreeBSD - src/usrbin/ar.h (it was removed some time ago, but it is still in the version control).
Also, the Wikipedia page for the AR file format has a nice diagram that describes the file format (it is from a .deb package which is also an ar
file).
File format
This file has a very simple structure:
- File signature (the one that identifies this as an
ar
file). - For every file in the archive we have:
- A header that contains file name, owner, group, size, and permissions (see header file).
- The file contents
- And optionally padding (\n).
.ar
files and they implemented their own ar encoder/decoder instead of using the ar
utility see DPKG ar.c –
Exclude Some information on IBM website: http://pic.dhe.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2Far_big.htm
© 2022 - 2024 — McMap. All rights reserved.
ar
a static library? You might perhaps uselibbfd
.... – Intacttar
.... Seetar(5)
man page or<tar.h>
header for its description. – Intact