codeclysm / extract Goto Github PK
View Code? Open in Web Editor NEWA Go library to extract archives in zip, tar.gz or tar.bz2 formats
License: MIT License
A Go library to extract archives in zip, tar.gz or tar.bz2 formats
License: MIT License
instead of read the whole body into a buffer, can we try zipstream like java ZipInputStream?
github.com/xenking/zipstream
zr := zipstream.NewReader(&zipFile)
meta, err := zr.Next()
if err != nil {
if err != io.EOF {
panic(err)
}
}
log.Printf("file name: %s", meta.Name)
compressedFile, err := ioutil.ReadAll(zr)
if err != nil {
panic(err)
}
log.Printf("file content: %s", string(compressedFile[:]))
Is it possible a situation like this?
extract.Archive(file, folder, func(path string) string {
if strings.Contains(path, "file") {
return all files of that directory
}
return ""
})
The readme and docs reference extract.TarBz2
but no such function is defined in this package.
This project seems more developed: https://github.com/mholt/archiver. Is there a reason I would use this project over mholt's?
Support strip parameter (len, integer) for the target extract directory so that root directories of the extracted content can be skipped.
Best regards
Jonas
Instead of extracting into a target directory, support extracting into memory / io buffer.
Best regards
Jonas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.