archive
Version, currently 0.5.05 versions
github.com/hkalexling/archive.cr
libarchive bindings for Crystal
3 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
archive:
github: hkalexling/archive.cr
version: ~> 0.5.0Then run:
shards installshard.yml
- Crystal
1.0.0- License
- MIT
- Author
- Alex Ling <hkalexling@gmail.com>
Dependencies
This version declares no dependencies.
README
# archive.cr

`archive.cr` provides [libarchive](https://github.com/libarchive/libarchive) bindings for Crystal. Only a small subset of the libarchive functions are implemented, and currently only extraction is supported.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
archive:
github: hkalexling/archive.cr
```
2. Run `shards install`
## Usage
```crystal
require "archive"
# Extract all entries
Archive::File.open "file.zip" do |f|
f.entries.map do |e|
# Skip non-file entries
next unless e.info.file?
filename = e.filename
size = e.size
file = File.new filename, "wb"
file.write e.read
end
end
# Extract a specific entry
Archive::File.open "file.zip" do |f|
file = File.new "img.jpg", "wb"
file.write f.read_entry "img.jpg"
end
```
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.5.0- Tagged
- Aug 20, 2021
- Commit
97c2a3433373- Crystal
1.0.0- Indexed
- yes
Dependents
Repository
github.com/hkalexling/archive.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 5