fat

package
v0.0.0-...-759cef8 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RDONLY = 1 << iota
	HIDDEN
	SYSTEM
	VOLUME_LABEL
	DIRECTORY
	ARCHIVE
	DEVICE
)
View Source
const (
	PathSeparator = '/'
)

Variables

View Source
var (
	ErrNotDir = errors.New("not a directory")
	ErrIsDir  = errors.New("is a directory")
)

Functions

func IsPathSeparator

func IsPathSeparator(c uint8) bool

func LFNChecksum

func LFNChecksum(buf []byte) uint8

Types

type Dir

type Dir struct {
	Name [8]uint8
	Ext  [3]uint8
	Attr uint8

	Ctimetenth uint8
	Ctime      uint16
	Cdate      uint16
	Adate      uint16
	Cluster32  uint16
	Time       uint16
	Date       uint16
	Cluster    uint16
	Length     uint32
	// contains filtered or unexported fields
}

type File

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

func (*File) Close

func (f *File) Close() error

func (*File) IsDir

func (f *File) IsDir() bool

func (*File) ModTime

func (f *File) ModTime() time.Time

func (*File) Mode

func (f *File) Mode() os.FileMode

func (*File) Name

func (f *File) Name() string

func (*File) Read

func (f *File) Read(b []byte) (int, error)

func (*File) Readdir

func (f *File) Readdir(n int) ([]os.FileInfo, error)

func (*File) Seek

func (f *File) Seek(off int64, whence int) (int64, error)

func (*File) Size

func (f *File) Size() int64

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

func (*File) Sys

func (f *File) Sys() interface{}

func (*File) Write

func (f *File) Write(b []byte) (int, error)

type FileSystem

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

func NewFileSystem

func NewFileSystem(rw iod.RW, opt *FileSystemOptions) (*FileSystem, error)

func (*FileSystem) Chdir

func (fs *FileSystem) Chdir(dir string) error

func (*FileSystem) Chmod

func (fs *FileSystem) Chmod(name string, mode os.FileMode) error

func (*FileSystem) Create

func (fs *FileSystem) Create(name string) (*File, error)

func (*FileSystem) Getwd

func (fs *FileSystem) Getwd() (string, error)

func (*FileSystem) Lstat

func (fs *FileSystem) Lstat(name string) (os.FileInfo, error)

func (*FileSystem) Mkdir

func (fs *FileSystem) Mkdir(name string, perm os.FileMode) error

func (*FileSystem) MkdirAll

func (fs *FileSystem) MkdirAll(path string, perm os.FileMode) error

func (*FileSystem) Open

func (fs *FileSystem) Open(name string) (*File, error)

func (*FileSystem) OpenFile

func (fs *FileSystem) OpenFile(name string, flag int, perm os.FileMode) (*File, error)

func (*FileSystem) Stat

func (fs *FileSystem) Stat(name string) (os.FileInfo, error)

func (*FileSystem) String

func (fs *FileSystem) String() string

type FileSystemOptions

type FileSystemOptions struct {
	Case bool
}

type LFN

type LFN struct {
	Seq      uint8
	Name0    [5]uint16
	Attr     uint8
	Type     uint8
	Checksum uint8
	Name1    [6]uint16
	Cluster  uint16
	Name2    [2]uint16
}

type PBS

type PBS struct {
	Magic     [3]uint8
	Version   [8]uint8
	Sectsz    uint16
	Clustersz uint8
	Resrv     uint16
	NumFats   uint8
	Rootsz    uint16
	Volsz     uint16
	Mediadesc uint8
	Fatsz     uint16
	Trksz     uint16
	Heads     uint16
	Hidden    uint32
	Bigvolsz  uint32
	Driveno   uint8

	Bootsig uint8
	Volid   uint32
	Label   [11]uint8
	Fstype  [8]uint8
	// contains filtered or unexported fields
}

type PBS32

type PBS32 struct {
	Magic      [3]uint8
	Version    [8]uint8
	Sectsz     uint16
	Clustsz    uint8
	Resrv      uint16
	NumFats    uint8
	Rootsz     uint16
	Volsz      uint16
	Mediadesc  uint8
	Fatsz      uint16
	Trksz      uint16
	Heads      uint16
	Hidden     uint32
	Bigvolsz   uint32
	Fatsz32    uint32
	Extflags   uint16
	Version1   uint16
	Rootstart  uint32
	Infospec   uint16
	Backupboot uint16

	PhysDrive    uint8
	Flags        uint8
	ExtendedBoot uint8
	VolumeSerial uint32
	Label        [11]byte
	Fstype       [8]byte
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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