cpio

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package cpio writes the "newc" cpio archive format used by the Linux initramfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Name string
	Mode uint32
	Size uint32
	Uid  uint32
	Gid  uint32
	Mtim uint32
	Link string // target for symlinks; ignored otherwise
}

type Writer

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

func NewWriter

func NewWriter(w io.Writer) *Writer

func (*Writer) Close

func (cw *Writer) Close() error

Close writes the trailer entry.

func (*Writer) WriteDir

func (cw *Writer) WriteDir(name string, mode uint32) error

WriteDir writes a directory entry.

func (*Writer) WriteFile

func (cw *Writer) WriteFile(h Header, data []byte) error

WriteFile writes a regular file entry followed by its data.

func (*Writer) WriteNod

func (cw *Writer) WriteNod(name string, mode uint32, major, minor uint32) error

WriteNod writes a character or block device node entry.

func (cw *Writer) WriteSymlink(name, target string, mode uint32) error

WriteSymlink writes a symlink entry whose payload is the link target.

Jump to

Keyboard shortcuts

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