Work with rar files in go
go get -v https://github.com/mpendlebury/gounrar
import "github.com/markpendlebury/gounrar"
func Unrar {
err := unrar.RarExtractor("myrarfile.rar", "folder/to/extract/to/")
if err != nil{
fmt.ErrorF("Error unpacking rar file: %v", err)
}
}
func GetFilenameFromWithinArchive {
filename, err := unrar.GetRarContents("myrarfile.rar")
if err != nil {
fmt.ErrorF("Error getting rar contents: %v", err)
}
fmt.Println("Found: " + filename)
}
- Unpack rar file
- Get first filename from within an archive
- Get a list of files from within an archive
- Get file size(s) from within an archive
Jagadeesh Kotra for the base concept Nicholas Waples for rardecode