fat32

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FSTypeFAT32 = "fat32"
	// Magic is the VFAT magic signature.
	FAT32Magic = "FAT32"
	// FAT32FSInfoSectorSignatureStart is the 4 bytes that signify the beginning of a FAT32 FS Information Sector
	FAT32FSInfoSectorSignatureStart uint32 = 0x41615252
	// FAT32FSInfoSectorSignatureMid is the 4 bytes that signify the middle bytes 484-487 of a FAT32 FS Information Sector
	FAT32FSInfoSectorSignatureMid uint32 = 0x61417272
	// FAT32FSInfoSectorSignatureEnd is the 4 bytes that signify the end of a FAT32 FS Information Sector
	FAT32FSInfoSectorSignatureEnd uint32 = 0xAA550000
)

Variables

View Source
var ErrNotFAT32 = errors.New("Not a fat32 partition")

Functions

This section is empty.

Types

type FAT32

type FAT32 struct {
	SuperBlock *FAT32SuperBlock
	// contains filtered or unexported fields
}

func NewFAT32

func NewFAT32() *FAT32

func (*FAT32) ByteOrder

func (f32 *FAT32) ByteOrder() binary.ByteOrder

func (*FAT32) FSBlockSize

func (f32 *FAT32) FSBlockSize() uint64

func (*FAT32) FreeCapacity

func (f32 *FAT32) FreeCapacity() uint64

func (*FAT32) ProbeFS

func (f32 *FAT32) ProbeFS(devicePath string, startOffset int64) (bool, error)

func (*FAT32) TotalCapacity

func (f32 *FAT32) TotalCapacity() uint64

func (*FAT32) Type

func (f32 *FAT32) Type() string

func (*FAT32) UUID

func (f32 *FAT32) UUID() (string, error)

type FAT32CapacityInfo

type FAT32CapacityInfo struct {
	TotalCapacity uint64
	FreeCapacity  uint64
}

type FAT32FSInformationSector

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

type FAT32SuperBlock

type FAT32SuperBlock struct {
	Ignored     [3]uint8
	Sysid       [8]uint8 // OEM name/version
	SectorSize  [2]uint8 // Number of bytes per sector
	ClusterSize uint8    // Number of sectors per cluster
	Reserved    uint16   //  Number of reserved sectors
	Fats        uint8    // Number of FAT copies
	DirEntries  [2]uint8 // Number of root directory entries
	Sectors     [2]uint8 // Total number of sectors in the filesystem
	Media       uint8    //  Media descriptor type
	FatLength   uint16   // Number of sectors per FAT
	SecsTrack   uint16   // Number of sectors per track
	Heads       uint16   // Number of heads
	Hidden      uint32   // Number of hidden sectors
	/* BIOS Parameter Block ends here */
	// Bootstrap
	TotalSect    uint32
	Fat32Length  uint32
	Flags        uint16
	Version      [2]uint8
	RootCluster  uint32
	FsinfoSector uint16
	BackupBoot   uint16
	Reserved2    [6]uint16
	Unknown      [3]uint8
	Serno        [4]uint8
	Label        [11]uint8
	Magic        [8]uint8
	Dummy2       [0x1fe - 0x5a]uint8
	Pmagic       [2]uint8
}

func (*FAT32SuperBlock) Is

func (f32 *FAT32SuperBlock) Is() bool

Jump to

Keyboard shortcuts

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