cpio

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const (
	S_ISUID  = 04000   // Set uid
	S_ISGID  = 02000   // Set gid
	S_ISVTX  = 01000   // Save text (sticky bit)
	S_ISDIR  = 040000  // Directory
	S_ISFIFO = 010000  // FIFO
	S_ISREG  = 0100000 // Regular file
	S_ISLNK  = 0120000 // Symbolic link
	S_ISBLK  = 060000  // Block special file
	S_ISCHR  = 020000  // Character special file
	S_ISSOCK = 0140000 // Socket
)

Standard set of permission bit masks.

View Source
const TRAILER = "TRAILER!!!"

Variables

View Source
var ErrStrippedHeader = errors.New("invalid cpio header: rpm-style stripped cpio requires supplemental size info")

Functions

func Extract

func Extract(rs io.Reader, dest string) error

Extract the contents of a cpio stream from r to the destination directory dest

Types

type CpioEntry

type CpioEntry struct {
	Header *Cpio_newc_header
	// contains filtered or unexported fields
}

type CpioStream

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

func NewCpioStream

func NewCpioStream(stream io.Reader) *CpioStream

func (*CpioStream) ReadNextEntry

func (cs *CpioStream) ReadNextEntry() (*CpioEntry, error)

func (*CpioStream) SetFileSizes

func (cs *CpioStream) SetFileSizes(sizes []int64)

Provide supplemental file size info so that RPMs with files > 4GiB can be read

type Cpio_newc_header

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

func (*Cpio_newc_header) Check

func (hdr *Cpio_newc_header) Check() int

func (*Cpio_newc_header) Devmajor

func (hdr *Cpio_newc_header) Devmajor() int

func (*Cpio_newc_header) Devminor

func (hdr *Cpio_newc_header) Devminor() int

func (*Cpio_newc_header) Filename

func (hdr *Cpio_newc_header) Filename() string

func (*Cpio_newc_header) Filesize

func (hdr *Cpio_newc_header) Filesize() int

func (*Cpio_newc_header) Filesize64

func (hdr *Cpio_newc_header) Filesize64() int64

func (*Cpio_newc_header) Gid

func (hdr *Cpio_newc_header) Gid() int

func (*Cpio_newc_header) Index

func (hdr *Cpio_newc_header) Index() int

func (*Cpio_newc_header) Ino

func (hdr *Cpio_newc_header) Ino() int

func (*Cpio_newc_header) IsStripped

func (hdr *Cpio_newc_header) IsStripped() bool

func (*Cpio_newc_header) Magic

func (hdr *Cpio_newc_header) Magic() string

func (*Cpio_newc_header) Mode

func (hdr *Cpio_newc_header) Mode() int

func (*Cpio_newc_header) Mtime

func (hdr *Cpio_newc_header) Mtime() int

func (*Cpio_newc_header) Namesize

func (hdr *Cpio_newc_header) Namesize() int
func (hdr *Cpio_newc_header) Nlink() int

func (*Cpio_newc_header) Rdevmajor

func (hdr *Cpio_newc_header) Rdevmajor() int

func (*Cpio_newc_header) Rdevminor

func (hdr *Cpio_newc_header) Rdevminor() int

func (*Cpio_newc_header) Uid

func (hdr *Cpio_newc_header) Uid() int

type Reader

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

func NewReader

func NewReader(stream io.Reader) *Reader

func NewReaderWithSizes

func NewReaderWithSizes(stream io.Reader, sizes []int64) *Reader

func (*Reader) Next

func (r *Reader) Next() (*Cpio_newc_header, error)

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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