ebfat

package
v0.0.0-...-ee59927 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFat

func CreateFat(files []File, out io.Writer, label string) (err error)

Types

type BootSectorHead

type BootSectorHead struct {
	Jump    [3]byte
	OemName [8]byte
	// BPB
	BytesPerSector    uint16
	SectorsPerCluster uint8
	ReservedSectors   uint16
	NumberOfFATs      uint8
	RootDirEntries    uint16
	NumberOfSectors   uint16
	MediaDescriptor   uint8
	SectorsPerFAT     uint16

	// Extended BPB
	PhysicalDriveNumber uint8

	ExtendedBootSignature uint8
	VolumeID              [4]byte
	PartitionLabel        [11]byte
	FileSystemType        [8]byte
	// contains filtered or unexported fields
}
var (
	InitBootSectorHead BootSectorHead = BootSectorHead{
		Jump: [3]byte{0xeb, 0xfe, 0x90},

		BytesPerSector:    512,
		SectorsPerCluster: 1,
		ReservedSectors:   1,
		NumberOfFATs:      1,
		RootDirEntries:    16,
		NumberOfSectors:   3,
		MediaDescriptor:   0xf8,
		SectorsPerFAT:     1,

		PhysicalDriveNumber:   0x80,
		ExtendedBootSignature: 0x29,
	}
)

type DirEntry

type DirEntry struct {
	FileNameExt    Dos83FileNameExt
	Attributes     uint8 // always 0x20 - archive
	ExtendedAttrs  uint8 // always 0x00
	CreateTime10ms uint8
	CreateTime     uint16
	CreateDate     uint16
	AccessDate     uint16
	ExtendedAttrs1 uint16 // always 0x0000
	ModifyTime     uint16
	ModifyDate     uint16
	FirstCluster   uint16
	FileSize       uint32
}

type Dos83FileNameExt

type Dos83FileNameExt struct {
	FileNameExt [11]byte
}

func (*Dos83FileNameExt) FillFromLongName

func (df *Dos83FileNameExt) FillFromLongName(fileName string)

func (*Dos83FileNameExt) LFNChecksum

func (df *Dos83FileNameExt) LFNChecksum() uint8

type Fat12Writer

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

func NewFat12Writer

func NewFat12Writer(w io.Writer) *Fat12Writer

func (*Fat12Writer) Flush

func (fw *Fat12Writer) Flush() error

func (*Fat12Writer) Write

func (fw *Fat12Writer) Write(num uint16) error

type File

type File struct {
	Name string
	Size int64
	io.Reader
}

type LFNEntry

type LFNEntry struct {
	SequenceNumber    uint8
	NamePart1         [5]uint16
	Attributes        uint8 // always 0x0f
	Type              uint8 // always 0x00
	ShortNameChecksum uint8
	NamePart2         [6]uint16
	FirstCluster      uint16 // always 0x0000
	NamePart3         [2]uint16
}

type PaddedWriter

type PaddedWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewPaddedWriter

func NewPaddedWriter(w io.Writer, padding int) *PaddedWriter

func (*PaddedWriter) Pad

func (w *PaddedWriter) Pad() error

func (*PaddedWriter) Write

func (w *PaddedWriter) Write(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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