/gounrar

Work with rar files in go

Primary LanguageGoGNU General Public License v3.0GPL-3.0

go unrar

Go Reference

Work with rar files in go

Install

go get -v https://github.com/mpendlebury/gounrar

Usage

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)
}

TODO

  • 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

Credits

Jagadeesh Kotra for the base concept Nicholas Waples for rardecode