cpio

package
v1.1.271 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Magic   = "070707"
	Trailer = "TRAILER!!!"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Info FileInfo
	Name string
	Size int64
	// contains filtered or unexported fields
}

func (*File) Open

func (f *File) Open() (io.ReadCloser, error)

Multiple files may be read concurrently.

func (*File) OpenRaw

func (f *File) OpenRaw() (*io.SectionReader, error)

type FileInfo

type FileInfo struct {
	DeviceNo uint64
	Inode    uint64
	Mode     fs.FileMode
	Uid      int
	Gid      int
	NLink    int
	RDev     int
	Mtime    time.Time
}
type Header struct {
	Magic    [6]byte
	Dev      [6]byte
	Ino      [6]byte
	Mode     [6]byte
	UID      [6]byte
	GID      [6]byte
	NLink    [6]byte
	RDev     [6]byte
	MTime    [11]byte
	NameSize [6]byte
	FileSize [11]byte
}

https://www.mkssoftware.com/docs/man4/cpio.4.asp

type ReadCloser

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

A ReadCloser is a Reader that must be closed when no longer needed.

func Open

func Open(name string) (*ReadCloser, error)

OpenReader will open the CPIO file specified by name and return a Reader.

func (*ReadCloser) Close

func (r *ReadCloser) Close() error

type Reader

type Reader struct {
	Files map[string]*File
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.ReaderAt, size int64) (*Reader, error)

NewReader will create a new Reader from the given io.ReaderAt and size.

Jump to

Keyboard shortcuts

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