pak

package
v1.0.304 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Magic           = (('K' << 24) + ('C' << 16) + ('A' << 8) + 'P')
	HeaderLength    = 12
	FileBlockLength = 64 // name + offset + length
	FileNameLength  = 56
	FileOffset      = 56
	FileLength      = 60
	Separator       = "/" // always use linux-style, even on windows
)

Variables

This section is empty.

Functions

func AddFiles added in v1.0.233

func AddFiles(archive *pb.PAKArchive, name string, data []byte)

Add a new file to the contents of the PAK. You'll need to have already os.ReadFile()'d to get the data.

func ExtractFile added in v1.0.233

func ExtractFile(archive *pb.PAKArchive, name string) (*pb.PAKFile, error)

Obtain a pointer to a file contained in a PAK archive.

func Marshal added in v1.0.233

func Marshal(archive *pb.PAKArchive) ([]byte, error)

generate a binary pak, it should be written to disk after.

func RemoveFile added in v1.0.233

func RemoveFile(archive *pb.PAKArchive, name string) error

Delete a file contained in a PAK archive

func Unmarshal added in v1.0.233

func Unmarshal(data []byte) (*pb.PAKArchive, error)

Types

type PKZFile

type PKZFile struct {
	Filename string
	Handle   *os.File
	Size     int64
}

func NewPKZFile

func NewPKZFile(filename string) (*PKZFile, error)

func OpenPKZFile

func OpenPKZFile(filename string) (*PKZFile, error)

func (*PKZFile) AddFile

func (pkz *PKZFile) AddFile(filepath string) error

Add a new file to our PKZ archive

func (*PKZFile) Close

func (pkz *PKZFile) Close()

func (*PKZFile) ListFiles

func (pkz *PKZFile) ListFiles() ([]string, error)

Jump to

Keyboard shortcuts

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