vfat

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package vfat probes FAT12/FAT16/FAT32 filesystems.

Index

Constants

View Source
const (
	FAT_ENTRY_FREE     = 0xe5
	FAT_ATTR_LONG_NAME = 0x0f
	FAT_ATTR_MASK      = 0x3f
	FAT_ATTR_VOLUME_ID = 0x08
	FAT_ATTR_DIR       = 0x10
)

FAT directory constants.

View Source
const DIRENTRY_SIZE = 32

DIRENTRY_SIZE is the size of the DirEntry struct.

View Source
const MSDOSSB_SIZE = 512

MSDOSSB_SIZE is the size of the MSDOSSB struct.

View Source
const VFATSB_SIZE = 524

VFATSB_SIZE is the size of the VFATSB struct.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirEntry added in v2.0.7

type DirEntry []byte

DirEntry is a byte slice representing the direntry.h C header.

func (DirEntry) Get_attr added in v2.0.7

func (s DirEntry) Get_attr() byte

Get_attr returns attr.

func (DirEntry) Get_cluster_high added in v2.0.7

func (s DirEntry) Get_cluster_high() uint16

Get_cluster_high returns cluster_high.

func (DirEntry) Get_cluster_low added in v2.0.7

func (s DirEntry) Get_cluster_low() uint16

Get_cluster_low returns cluster_low.

func (DirEntry) Get_date_acc added in v2.0.7

func (s DirEntry) Get_date_acc() uint16

Get_date_acc returns date_acc.

func (DirEntry) Get_date_creat added in v2.0.7

func (s DirEntry) Get_date_creat() uint16

Get_date_creat returns date_creat.

func (DirEntry) Get_date_write added in v2.0.7

func (s DirEntry) Get_date_write() uint16

Get_date_write returns date_write.

func (DirEntry) Get_name added in v2.0.7

func (s DirEntry) Get_name() []byte

Get_name returns name.

func (DirEntry) Get_size added in v2.0.7

func (s DirEntry) Get_size() uint32

Get_size returns size.

func (DirEntry) Get_time_acc added in v2.0.7

func (s DirEntry) Get_time_acc() uint16

Get_time_acc returns time_acc.

func (DirEntry) Get_time_creat added in v2.0.7

func (s DirEntry) Get_time_creat() uint16

Get_time_creat returns time_creat.

func (DirEntry) Get_time_write added in v2.0.7

func (s DirEntry) Get_time_write() uint16

Get_time_write returns time_write.

func (DirEntry) Put_attr added in v2.0.7

func (s DirEntry) Put_attr(v byte)

Put_attr sets attr.

func (DirEntry) Put_cluster_high added in v2.0.7

func (s DirEntry) Put_cluster_high(v uint16)

Put_cluster_high sets cluster_high.

func (DirEntry) Put_cluster_low added in v2.0.7

func (s DirEntry) Put_cluster_low(v uint16)

Put_cluster_low sets cluster_low.

func (DirEntry) Put_date_acc added in v2.0.7

func (s DirEntry) Put_date_acc(v uint16)

Put_date_acc sets date_acc.

func (DirEntry) Put_date_creat added in v2.0.7

func (s DirEntry) Put_date_creat(v uint16)

Put_date_creat sets date_creat.

func (DirEntry) Put_date_write added in v2.0.7

func (s DirEntry) Put_date_write(v uint16)

Put_date_write sets date_write.

func (DirEntry) Put_name added in v2.0.7

func (s DirEntry) Put_name(v []byte)

Put_name sets name.

func (DirEntry) Put_size added in v2.0.7

func (s DirEntry) Put_size(v uint32)

Put_size sets size.

func (DirEntry) Put_time_acc added in v2.0.7

func (s DirEntry) Put_time_acc(v uint16)

Put_time_acc sets time_acc.

func (DirEntry) Put_time_creat added in v2.0.7

func (s DirEntry) Put_time_creat(v uint16)

Put_time_creat sets time_creat.

func (DirEntry) Put_time_write added in v2.0.7

func (s DirEntry) Put_time_write(v uint16)

Put_time_write sets time_write.

type MSDOSSB

type MSDOSSB []byte

MSDOSSB is a byte slice representing the msdos.h C header.

func (MSDOSSB) Get_ms_boot_flags

func (s MSDOSSB) Get_ms_boot_flags() byte

Get_ms_boot_flags returns ms_boot_flags.

func (MSDOSSB) Get_ms_cluster_size

func (s MSDOSSB) Get_ms_cluster_size() byte

Get_ms_cluster_size returns ms_cluster_size.

func (MSDOSSB) Get_ms_dir_entries

func (s MSDOSSB) Get_ms_dir_entries() uint16

Get_ms_dir_entries returns ms_dir_entries.

func (MSDOSSB) Get_ms_drive_number

func (s MSDOSSB) Get_ms_drive_number() byte

Get_ms_drive_number returns ms_drive_number.

func (MSDOSSB) Get_ms_dummy2

func (s MSDOSSB) Get_ms_dummy2() []byte

Get_ms_dummy2 returns ms_dummy2.

func (MSDOSSB) Get_ms_ext_boot_sign

func (s MSDOSSB) Get_ms_ext_boot_sign() byte

Get_ms_ext_boot_sign returns 0x28 - DOS 3.4 EBPB; 0x29 - DOS 4.0 EBPB.

func (MSDOSSB) Get_ms_fat_length

func (s MSDOSSB) Get_ms_fat_length() uint16

Get_ms_fat_length returns Sectors per FAT.

func (MSDOSSB) Get_ms_fats

func (s MSDOSSB) Get_ms_fats() byte

Get_ms_fats returns ms_fats.

func (MSDOSSB) Get_ms_heads

func (s MSDOSSB) Get_ms_heads() uint16

Get_ms_heads returns ms_heads.

func (MSDOSSB) Get_ms_hidden

func (s MSDOSSB) Get_ms_hidden() uint32

Get_ms_hidden returns ms_hidden.

func (MSDOSSB) Get_ms_ignored

func (s MSDOSSB) Get_ms_ignored() []byte

Get_ms_ignored returns ms_ignored.

func (MSDOSSB) Get_ms_label

func (s MSDOSSB) Get_ms_label() []byte

Get_ms_label returns ms_label.

func (MSDOSSB) Get_ms_magic

func (s MSDOSSB) Get_ms_magic() []byte

Get_ms_magic returns ms_magic.

func (MSDOSSB) Get_ms_media

func (s MSDOSSB) Get_ms_media() byte

Get_ms_media returns ms_media.

func (MSDOSSB) Get_ms_pmagic

func (s MSDOSSB) Get_ms_pmagic() []byte

Get_ms_pmagic returns ms_pmagic.

func (MSDOSSB) Get_ms_reserved

func (s MSDOSSB) Get_ms_reserved() uint16

Get_ms_reserved returns ms_reserved.

func (MSDOSSB) Get_ms_secs_track

func (s MSDOSSB) Get_ms_secs_track() uint16

Get_ms_secs_track returns ms_secs_track.

func (MSDOSSB) Get_ms_sector_size

func (s MSDOSSB) Get_ms_sector_size() uint16

Get_ms_sector_size returns ms_sector_size.

func (MSDOSSB) Get_ms_sectors

func (s MSDOSSB) Get_ms_sectors() uint16

Get_ms_sectors returns =0 iff V3 or later.

func (MSDOSSB) Get_ms_serno

func (s MSDOSSB) Get_ms_serno() []byte

Get_ms_serno returns ms_serno.

func (MSDOSSB) Get_ms_sysid

func (s MSDOSSB) Get_ms_sysid() []byte

Get_ms_sysid returns ms_sysid.

func (MSDOSSB) Get_ms_total_sect

func (s MSDOSSB) Get_ms_total_sect() uint32

Get_ms_total_sect returns iff ms_sectors == 0.

func (MSDOSSB) Put_ms_boot_flags

func (s MSDOSSB) Put_ms_boot_flags(v byte)

Put_ms_boot_flags sets ms_boot_flags.

func (MSDOSSB) Put_ms_cluster_size

func (s MSDOSSB) Put_ms_cluster_size(v byte)

Put_ms_cluster_size sets ms_cluster_size.

func (MSDOSSB) Put_ms_dir_entries

func (s MSDOSSB) Put_ms_dir_entries(v uint16)

Put_ms_dir_entries sets ms_dir_entries.

func (MSDOSSB) Put_ms_drive_number

func (s MSDOSSB) Put_ms_drive_number(v byte)

Put_ms_drive_number sets ms_drive_number.

func (MSDOSSB) Put_ms_dummy2

func (s MSDOSSB) Put_ms_dummy2(v []byte)

Put_ms_dummy2 sets ms_dummy2.

func (MSDOSSB) Put_ms_ext_boot_sign

func (s MSDOSSB) Put_ms_ext_boot_sign(v byte)

Put_ms_ext_boot_sign sets 0x28 - DOS 3.4 EBPB; 0x29 - DOS 4.0 EBPB.

func (MSDOSSB) Put_ms_fat_length

func (s MSDOSSB) Put_ms_fat_length(v uint16)

Put_ms_fat_length sets Sectors per FAT.

func (MSDOSSB) Put_ms_fats

func (s MSDOSSB) Put_ms_fats(v byte)

Put_ms_fats sets ms_fats.

func (MSDOSSB) Put_ms_heads

func (s MSDOSSB) Put_ms_heads(v uint16)

Put_ms_heads sets ms_heads.

func (MSDOSSB) Put_ms_hidden

func (s MSDOSSB) Put_ms_hidden(v uint32)

Put_ms_hidden sets ms_hidden.

func (MSDOSSB) Put_ms_ignored

func (s MSDOSSB) Put_ms_ignored(v []byte)

Put_ms_ignored sets ms_ignored.

func (MSDOSSB) Put_ms_label

func (s MSDOSSB) Put_ms_label(v []byte)

Put_ms_label sets ms_label.

func (MSDOSSB) Put_ms_magic

func (s MSDOSSB) Put_ms_magic(v []byte)

Put_ms_magic sets ms_magic.

func (MSDOSSB) Put_ms_media

func (s MSDOSSB) Put_ms_media(v byte)

Put_ms_media sets ms_media.

func (MSDOSSB) Put_ms_pmagic

func (s MSDOSSB) Put_ms_pmagic(v []byte)

Put_ms_pmagic sets ms_pmagic.

func (MSDOSSB) Put_ms_reserved

func (s MSDOSSB) Put_ms_reserved(v uint16)

Put_ms_reserved sets ms_reserved.

func (MSDOSSB) Put_ms_secs_track

func (s MSDOSSB) Put_ms_secs_track(v uint16)

Put_ms_secs_track sets ms_secs_track.

func (MSDOSSB) Put_ms_sector_size

func (s MSDOSSB) Put_ms_sector_size(v uint16)

Put_ms_sector_size sets ms_sector_size.

func (MSDOSSB) Put_ms_sectors

func (s MSDOSSB) Put_ms_sectors(v uint16)

Put_ms_sectors sets =0 iff V3 or later.

func (MSDOSSB) Put_ms_serno

func (s MSDOSSB) Put_ms_serno(v []byte)

Put_ms_serno sets ms_serno.

func (MSDOSSB) Put_ms_sysid

func (s MSDOSSB) Put_ms_sysid(v []byte)

Put_ms_sysid sets ms_sysid.

func (MSDOSSB) Put_ms_total_sect

func (s MSDOSSB) Put_ms_total_sect(v uint32)

Put_ms_total_sect sets iff ms_sectors == 0.

type Probe

type Probe struct{}

Probe for the filesystem.

func (*Probe) Magic

func (p *Probe) Magic() []*magic.Magic

Magic returns the magic value for the filesystem.

func (*Probe) Name

func (p *Probe) Name() string

Name returns the name of the filesystem.

func (*Probe) Probe

func (p *Probe) Probe(r probe.Reader, _ magic.Magic) (*probe.Result, error)

Probe runs the further inspection and returns the result if successful.

type VFATSB

type VFATSB []byte

VFATSB is a byte slice representing the vfat.h C header.

func (VFATSB) Get_vs_backup_boot

func (s VFATSB) Get_vs_backup_boot() uint16

Get_vs_backup_boot returns vs_backup_boot.

func (VFATSB) Get_vs_boot_flags

func (s VFATSB) Get_vs_boot_flags() byte

Get_vs_boot_flags returns vs_boot_flags.

func (VFATSB) Get_vs_cluster_size

func (s VFATSB) Get_vs_cluster_size() byte

Get_vs_cluster_size returns vs_cluster_size.

func (VFATSB) Get_vs_dir_entries

func (s VFATSB) Get_vs_dir_entries() uint16

Get_vs_dir_entries returns vs_dir_entries.

func (VFATSB) Get_vs_drive_number

func (s VFATSB) Get_vs_drive_number() byte

Get_vs_drive_number returns vs_drive_number.

func (VFATSB) Get_vs_dummy2

func (s VFATSB) Get_vs_dummy2() []byte

Get_vs_dummy2 returns vs_dummy2.

func (VFATSB) Get_vs_ext_boot_sign

func (s VFATSB) Get_vs_ext_boot_sign() byte

Get_vs_ext_boot_sign returns 0x28 - without vs_label/vs_magic; 0x29 - with.

func (VFATSB) Get_vs_fat32_length

func (s VFATSB) Get_vs_fat32_length() uint32

Get_vs_fat32_length returns vs_fat32_length.

func (VFATSB) Get_vs_fat_length

func (s VFATSB) Get_vs_fat_length() uint16

Get_vs_fat_length returns vs_fat_length.

func (VFATSB) Get_vs_fats

func (s VFATSB) Get_vs_fats() byte

Get_vs_fats returns vs_fats.

func (VFATSB) Get_vs_flags

func (s VFATSB) Get_vs_flags() uint16

Get_vs_flags returns vs_flags.

func (VFATSB) Get_vs_fsinfo_sector

func (s VFATSB) Get_vs_fsinfo_sector() uint16

Get_vs_fsinfo_sector returns vs_fsinfo_sector.

func (VFATSB) Get_vs_heads

func (s VFATSB) Get_vs_heads() uint16

Get_vs_heads returns vs_heads.

func (VFATSB) Get_vs_hidden

func (s VFATSB) Get_vs_hidden() uint32

Get_vs_hidden returns vs_hidden.

func (VFATSB) Get_vs_ignored

func (s VFATSB) Get_vs_ignored() []byte

Get_vs_ignored returns vs_ignored.

func (VFATSB) Get_vs_label

func (s VFATSB) Get_vs_label() []byte

Get_vs_label returns vs_label.

func (VFATSB) Get_vs_magic

func (s VFATSB) Get_vs_magic() []byte

Get_vs_magic returns vs_magic.

func (VFATSB) Get_vs_media

func (s VFATSB) Get_vs_media() byte

Get_vs_media returns vs_media.

func (VFATSB) Get_vs_pmagic

func (s VFATSB) Get_vs_pmagic() []byte

Get_vs_pmagic returns vs_pmagic.

func (VFATSB) Get_vs_reserved

func (s VFATSB) Get_vs_reserved() uint16

Get_vs_reserved returns vs_reserved.

func (VFATSB) Get_vs_root_cluster

func (s VFATSB) Get_vs_root_cluster() uint32

Get_vs_root_cluster returns vs_root_cluster.

func (VFATSB) Get_vs_secs_track

func (s VFATSB) Get_vs_secs_track() uint16

Get_vs_secs_track returns vs_secs_track.

func (VFATSB) Get_vs_sector_size

func (s VFATSB) Get_vs_sector_size() []byte

Get_vs_sector_size returns vs_sector_size.

func (VFATSB) Get_vs_sectors

func (s VFATSB) Get_vs_sectors() []byte

Get_vs_sectors returns vs_sectors.

func (VFATSB) Get_vs_serno

func (s VFATSB) Get_vs_serno() []byte

Get_vs_serno returns vs_serno.

func (VFATSB) Get_vs_sysid

func (s VFATSB) Get_vs_sysid() []byte

Get_vs_sysid returns vs_sysid.

func (VFATSB) Get_vs_total_sect

func (s VFATSB) Get_vs_total_sect() uint32

Get_vs_total_sect returns vs_total_sect.

func (VFATSB) Get_vs_version

func (s VFATSB) Get_vs_version() []byte

Get_vs_version returns vs_version.

func (VFATSB) Put_vs_backup_boot

func (s VFATSB) Put_vs_backup_boot(v uint16)

Put_vs_backup_boot sets vs_backup_boot.

func (VFATSB) Put_vs_boot_flags

func (s VFATSB) Put_vs_boot_flags(v byte)

Put_vs_boot_flags sets vs_boot_flags.

func (VFATSB) Put_vs_cluster_size

func (s VFATSB) Put_vs_cluster_size(v byte)

Put_vs_cluster_size sets vs_cluster_size.

func (VFATSB) Put_vs_dir_entries

func (s VFATSB) Put_vs_dir_entries(v uint16)

Put_vs_dir_entries sets vs_dir_entries.

func (VFATSB) Put_vs_drive_number

func (s VFATSB) Put_vs_drive_number(v byte)

Put_vs_drive_number sets vs_drive_number.

func (VFATSB) Put_vs_dummy2

func (s VFATSB) Put_vs_dummy2(v []byte)

Put_vs_dummy2 sets vs_dummy2.

func (VFATSB) Put_vs_ext_boot_sign

func (s VFATSB) Put_vs_ext_boot_sign(v byte)

Put_vs_ext_boot_sign sets 0x28 - without vs_label/vs_magic; 0x29 - with.

func (VFATSB) Put_vs_fat32_length

func (s VFATSB) Put_vs_fat32_length(v uint32)

Put_vs_fat32_length sets vs_fat32_length.

func (VFATSB) Put_vs_fat_length

func (s VFATSB) Put_vs_fat_length(v uint16)

Put_vs_fat_length sets vs_fat_length.

func (VFATSB) Put_vs_fats

func (s VFATSB) Put_vs_fats(v byte)

Put_vs_fats sets vs_fats.

func (VFATSB) Put_vs_flags

func (s VFATSB) Put_vs_flags(v uint16)

Put_vs_flags sets vs_flags.

func (VFATSB) Put_vs_fsinfo_sector

func (s VFATSB) Put_vs_fsinfo_sector(v uint16)

Put_vs_fsinfo_sector sets vs_fsinfo_sector.

func (VFATSB) Put_vs_heads

func (s VFATSB) Put_vs_heads(v uint16)

Put_vs_heads sets vs_heads.

func (VFATSB) Put_vs_hidden

func (s VFATSB) Put_vs_hidden(v uint32)

Put_vs_hidden sets vs_hidden.

func (VFATSB) Put_vs_ignored

func (s VFATSB) Put_vs_ignored(v []byte)

Put_vs_ignored sets vs_ignored.

func (VFATSB) Put_vs_label

func (s VFATSB) Put_vs_label(v []byte)

Put_vs_label sets vs_label.

func (VFATSB) Put_vs_magic

func (s VFATSB) Put_vs_magic(v []byte)

Put_vs_magic sets vs_magic.

func (VFATSB) Put_vs_media

func (s VFATSB) Put_vs_media(v byte)

Put_vs_media sets vs_media.

func (VFATSB) Put_vs_pmagic

func (s VFATSB) Put_vs_pmagic(v []byte)

Put_vs_pmagic sets vs_pmagic.

func (VFATSB) Put_vs_reserved

func (s VFATSB) Put_vs_reserved(v uint16)

Put_vs_reserved sets vs_reserved.

func (VFATSB) Put_vs_root_cluster

func (s VFATSB) Put_vs_root_cluster(v uint32)

Put_vs_root_cluster sets vs_root_cluster.

func (VFATSB) Put_vs_secs_track

func (s VFATSB) Put_vs_secs_track(v uint16)

Put_vs_secs_track sets vs_secs_track.

func (VFATSB) Put_vs_sector_size

func (s VFATSB) Put_vs_sector_size(v []byte)

Put_vs_sector_size sets vs_sector_size.

func (VFATSB) Put_vs_sectors

func (s VFATSB) Put_vs_sectors(v []byte)

Put_vs_sectors sets vs_sectors.

func (VFATSB) Put_vs_serno

func (s VFATSB) Put_vs_serno(v []byte)

Put_vs_serno sets vs_serno.

func (VFATSB) Put_vs_sysid

func (s VFATSB) Put_vs_sysid(v []byte)

Put_vs_sysid sets vs_sysid.

func (VFATSB) Put_vs_total_sect

func (s VFATSB) Put_vs_total_sect(v uint32)

Put_vs_total_sect sets vs_total_sect.

func (VFATSB) Put_vs_version

func (s VFATSB) Put_vs_version(v []byte)

Put_vs_version sets vs_version.

Jump to

Keyboard shortcuts

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