lha

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 10 Imported by: 0

README

LHa reader for golang

GoDoc

Very experimental package. Currently supports only extracting LH5 format and Lv2 header.

Example

See below files:

  • ./cmd/header/header.go
  • ./cmd/extract/extract.go

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Size         uint16
	Method       string
	PackedSize   uint64
	OriginalSize uint64
	Time         time.Time
	Attribute    uint8
	Level        uint8
	CRC          uint16
	OSID         uint8

	HeaderCRC *uint16
	Name      string
	Dir       string
	DOS       struct {
		Attr uint16
		Time uint64
	}
	UNIX struct {
		Perm  uint16
		GID   uint16
		UID   uint16
		Group string
		User  string
		Time  time.Time
	}
}

Header is header of file in LHA archive.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is LHA archive reader.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader creates LHA archive reader.

func (*Reader) CRC16

func (r *Reader) CRC16() uint16

CRC16 returns current CRC16 value.

func (*Reader) Decode

func (r *Reader) Decode(w io.Writer) (decoded int, err error)

Decode decodes a file to w. It returns decoded size and error.

func (*Reader) NextHeader

func (r *Reader) NextHeader() (h *Header, err error)

NextHeader reads a next file header.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL