https://github.com/mithro/go-archive-ar
Go library for reading/writing ar files -- ar is generally used for static library files and for generating .deb packages.
https://github.com/mithro/go-archive-ar
Last synced: about 1 year ago
JSON representation
Go library for reading/writing ar files -- ar is generally used for static library files and for generating .deb packages.
- Host: GitHub
- URL: https://github.com/mithro/go-archive-ar
- Owner: mithro
- License: apache-2.0
- Created: 2017-06-07T04:02:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T06:47:13.000Z (almost 9 years ago)
- Last Synced: 2025-03-18T05:54:51.527Z (about 1 year ago)
- Language: Go
- Homepage: https://en.wikipedia.org/wiki/Ar_(Unix)
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# archive/ar
Go library for reading/writing [ar files](https://en.wikipedia.org/wiki/Ar_(Unix))
From Wikipedia;
> ar is generally used only to create and update static library files that the
> link editor or linker uses and for generating .deb packages for the Debian
> family; it can be used to create archives for any purpose, but has been
> largely replaced by tar for purposes other than static libraries.
ar archives are the simplest format that stratifies the following criteria;
* Is an existing standard which has tools which ship on standard Linux
systems.
* Requires no escaping / processing of file contents.
* Header can be written without needing to understand the whole file.
* Extremely fast to process / generate.
Other formats which were consider before selecting the ar format;
* tar
* zip
* cpio
* rar
* Something protobuf based.
This ar format is ~5 times faster than the archive/tar equivalent which ships
with go 1.5 (newer Go versions might be faster).
There are a couple of drawbacks;
* The ar format doesn't support special files or symlinks.
* The Linux ar tool don't extract with directory paths (list fine).
This library only supports the
[BSD variant](https://en.wikipedia.org/wiki/Ar_(Unix)#BSD_variant)
for long file names.
# TODO
- [ ] Actually check this package can be used.
- [ ] Improve the test suite.
- [ ] Add some benchmarks.
- [ ] Add Travis CI.
- [ ] Add support for other variants.
- [ ] Add a "artool" which allows you to test the ar commands for creation /
extraction.
- [ ] Full support the archive interfaces.