gen2brain / Go Unarr
Licence: zlib
Go bindings for unarr (decompression library for RAR, TAR, ZIP and 7z archives)
Stars: ✭ 133
Labels
Projects that are alternatives of or similar to Go Unarr
uncompress.js
Uncompress ZIP, RAR, and TAR files with pure JavaScript
Stars: ✭ 79 (-40.6%)
Mutual labels: tar
Sharpcompress
SharpCompress is a fully managed C# library to deal with many compression types and formats.
Stars: ✭ 1,397 (+950.38%)
Mutual labels: tar
tar
Memory-efficient, streaming implementation of the tar archive format in Dart
Stars: ✭ 18 (-86.47%)
Mutual labels: tar
Extrakt
Extract .tar(.gz) using the system binary (fast!), with a javascript fallback (portable!)
Stars: ✭ 19 (-85.71%)
Mutual labels: tar
Ugrep
🔍NEW ugrep v3.1: ultra fast grep with interactive query UI and fuzzy search: search file systems, source code, text, binary files, archives (cpio/tar/pax/zip), compressed files (gz/Z/bz2/lzma/xz/lz4), documents and more. A faster, user-friendly and compatible grep replacement.
Stars: ✭ 626 (+370.68%)
Mutual labels: tar
Compressing
Everything you need for compressing and uncompressing
Stars: ✭ 268 (+101.5%)
Mutual labels: tar
Archiver
Easily create & extract archives, and compress & decompress files of various formats
Stars: ✭ 3,373 (+2436.09%)
Mutual labels: tar
go-mtree
File systems verification utility and library, in likeness of mtree(8)
Stars: ✭ 55 (-58.65%)
Mutual labels: tar
Swcompression
A Swift framework for working with compression, archives and containers.
Stars: ✭ 110 (-17.29%)
Mutual labels: tar
PLzmaSDK
PLzmaSDK is (Portable, Patched, Package, cross-P-latform) Lzma SDK.
Stars: ✭ 28 (-78.95%)
Mutual labels: tar
Awesome Terminal Commands
An awesome resource listing and explaining various commonly used *nix commands
Stars: ✭ 109 (-18.05%)
Mutual labels: tar
Squashfs Tools Ng
A new set of tools and libraries for working with SquashFS images
Stars: ✭ 76 (-42.86%)
Mutual labels: tar
go-unarr
Golang bindings for the unarr library from sumatrapdf.
unarr
is a decompression library and CLI for RAR, TAR, ZIP and 7z archives.
GoDoc
See https://pkg.go.dev/github.com/gen2brain/go-unarr
Install CLI
go get github.com/gen2brain/go-unarr/cmd/unarr
Example
unarr ./example.7z ./example/
Build
For one-off builds:
go build -o ./unarr ./cmd/unarr/*.go
For multi-platform cross-compile builds:
goreleaser --snapshot --skip-publish --rm-dist
See build.sh
for gcc toolchain information and for manual cross-platform build instructions.
Library Examples
Install Library
go get -v github.com/gen2brain/go-unarr
Open archive
a, err := unarr.NewArchive("test.7z")
if err != nil {
panic(err)
}
defer a.Close()
Read first entry from archive
err := a.Entry()
if err != nil {
panic(err)
}
data, err := a.ReadAll()
if err != nil {
panic(err)
}
List contents of archive
list, err := a.List()
if err != nil {
panic(err)
}
Read known filename from archive
err := a.EntryFor("filename.txt")
if err != nil {
panic(err)
}
data, err := a.ReadAll()
if err != nil {
panic(err)
}
Read first 8 bytes of the entry
err := a.Entry()
if err != nil {
panic(err)
}
data := make([]byte, 8)
n, err := a.Read(data)
if err != nil {
panic(err)
}
Read all entries from archive
for {
err := a.Entry()
if err != nil {
if err == io.EOF {
break
} else {
panic(err)
}
}
data, err := a.ReadAll()
if err != nil {
panic(err)
}
}
Extract contents of archive to destination path
err := a.Extract("/tmp/path")
if err != nil {
panic(err)
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].