nimarchive
nimarchive copied to clipboard
libarchive wrapper for Nim
Nimarchive is a Nim wrapper for the libarchive library.
Nimarchive is distributed as a Nimble package and depends on nimterop to generate the wrappers.
Installation
Nimarchive can be installed via Nimble:
> nimble install nimarchive
This will download and install nimarchive in the standard Nimble package location, typically ~/.nimble. Once installed, it can be imported into any Nim program.
bzip2, liblzma, zlib, lz4, expat and libiconv are also downloaded since they are required dependencies.
On Linux, acl and Attr are also downloaded.
Usage
Module documentation can be found here.
import nimarchive
extract("tests/nimarchive.7z", "destDir")
The extract()
API supports most popular archive formats and provides a generic interface. The archive.h
functions are directly accessible as well by importing nimarchive/archive
.
Refer to the tests
directory for examples on how the library can be used. The libarchive wiki is also a good reference guide.
Credits
Nimarchive wraps the libarchive source code and all licensing terms of libarchive apply to the usage of this package. The bzip2, liblzma, zlib, expat and libiconv terms also apply since they are dependencies.
On Linux, acl and Attr license terms also apply.
Feedback
Nimarchive is a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub with an MIT license so issues, forks and PRs are most appreciated.