image

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Copyright © 2025 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const MB = 1024 * 1024
View Source
const PAD_BYTES = 512

Variables

This section is empty.

Functions

func Fatal

func Fatal(err error) error

func Fatalf

func Fatalf(format string, args ...interface{}) error

func IsFile

func IsFile(filename string) bool

func MungeImage

func MungeImage(dstFilename, srcFilename string, basename string, files []string) error

func RewriteImage added in v0.0.6

func RewriteImage(dstFile, srcFile string, fatType int, size int64) error

Types

type FileRecord

type FileRecord struct {
	Name      string
	ShortName string
	Dir       bool
	Hidden    bool
	System    bool
	ReadOnly  bool
}

type Image

type Image struct {
	Filename string
	// contains filtered or unexported fields
}

func CreateImage

func CreateImage(filename, volumeLabel, oemName string, fatType int, size int64) (*Image, error)

func OpenImage

func OpenImage(filename string) (*Image, error)

func (*Image) AddFile

func (i *Image) AddFile(dstPathname, srcPathname string) error

func (*Image) Close

func (i *Image) Close() error

func (*Image) FATType added in v0.0.6

func (i *Image) FATType() (int, error)

func (*Image) GetAttr

func (i *Image) GetAttr(filename string) (ffs.DirectoryAttr, error)

func (*Image) Import

func (i *Image) Import(filename string) error

write all files in a directory to the image

func (*Image) Info added in v0.0.6

func (i *Image) Info() (map[string]any, error)

func (*Image) IsDir

func (i *Image) IsDir(name string) (bool, error)

func (*Image) Mkdir

func (i *Image) Mkdir(pathname string) error

func (*Image) OEMName added in v0.0.6

func (i *Image) OEMName() (string, error)

func (*Image) ReadFile

func (i *Image) ReadFile(filename string) ([]byte, error)

func (*Image) ScanFiles

func (i *Image) ScanFiles() ([]FileRecord, error)

func (*Image) SetAttr

func (i *Image) SetAttr(filename string, attr ffs.DirectoryAttr, state bool) error

func (*Image) VolumeLabel added in v0.0.6

func (i *Image) VolumeLabel() (string, error)

Jump to

Keyboard shortcuts

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