fatfs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	FileResultOK                          = C.FR_OK /* (0) Succeeded */
	FileResultErr              FileResult = C.FR_DISK_ERR
	FileResultIntErr           FileResult = C.FR_INT_ERR
	FileResultNotReady         FileResult = C.FR_NOT_READY
	FileResultNoFile           FileResult = C.FR_NO_FILE
	FileResultNoPath           FileResult = C.FR_NO_PATH
	FileResultInvalidName      FileResult = C.FR_INVALID_NAME
	FileResultDenied           FileResult = C.FR_DENIED
	FileResultExist            FileResult = C.FR_EXIST
	FileResultInvalidObject    FileResult = C.FR_INVALID_OBJECT
	FileResultWriteProtected   FileResult = C.FR_WRITE_PROTECTED
	FileResultInvalidDrive     FileResult = C.FR_INVALID_DRIVE
	FileResultNotEnabled       FileResult = C.FR_NOT_ENABLED
	FileResultNoFilesystem     FileResult = C.FR_NO_FILESYSTEM
	FileResultMkfsAborted      FileResult = C.FR_MKFS_ABORTED
	FileResultTimeout          FileResult = C.FR_TIMEOUT
	FileResultLocked           FileResult = C.FR_LOCKED
	FileResultNotEnoughCore    FileResult = C.FR_NOT_ENOUGH_CORE
	FileResultTooManyOpenFiles FileResult = C.FR_TOO_MANY_OPEN_FILES
	FileResultInvalidParameter FileResult = C.FR_INVALID_PARAMETER
	FileResultReadOnly         FileResult = 99

	TypeFAT12 Type = C.FS_FAT12
	TypeFAT16 Type = C.FS_FAT16
	TypeFAT32 Type = C.FS_FAT32
	TypeEXFAT Type = C.FS_EXFAT

	AttrReadOnly  FileAttr = C.AM_RDO
	AttrHidden    FileAttr = C.AM_HID
	AttrSystem    FileAttr = C.AM_SYS
	AttrDirectory FileAttr = C.AM_DIR
	AttrArchive   FileAttr = C.AM_ARC

	SectorSize = 512

	FileAccessRead         OpenFlag = C.FA_READ
	FileAccessWrite        OpenFlag = C.FA_WRITE
	FileAccessOpenExisting OpenFlag = C.FA_OPEN_EXISTING
	FileAccessCreateNew    OpenFlag = C.FA_CREATE_NEW
	FileAccessCreateAlways OpenFlag = C.FA_CREATE_ALWAYS
	FileAccessOpenAlways   OpenFlag = C.FA_OPEN_ALWAYS
	FileAccessOpenAppend   OpenFlag = C.FA_OPEN_APPEND
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SectorSize int
}

type FATFS

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

func New

func New(blockdev tinyfs.BlockDevice) *FATFS

func (*FATFS) Configure

func (l *FATFS) Configure(config *Config) *FATFS

func (*FATFS) Format

func (l *FATFS) Format() error

func (*FATFS) Free

func (l *FATFS) Free() (int64, error)

func (*FATFS) Mkdir

func (l *FATFS) Mkdir(path string, _ os.FileMode) error

func (*FATFS) Mount

func (l *FATFS) Mount() error

func (*FATFS) Open

func (l *FATFS) Open(path string) (tinyfs.File, error)

func (*FATFS) OpenFile

func (l *FATFS) OpenFile(path string, flags int) (tinyfs.File, error)

func (*FATFS) Remove

func (l *FATFS) Remove(path string) error

func (*FATFS) Rename

func (l *FATFS) Rename(oldPath string, newPath string) error

func (*FATFS) Stat

func (l *FATFS) Stat(path string) (os.FileInfo, error)

func (*FATFS) Unmount

func (l *FATFS) Unmount() error

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) Name

func (f *File) Name() string

Name returns the name of the file as presented to OpenFile

func (*File) Read

func (f *File) Read(buf []byte) (n int, err error)

func (*File) Readdir

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

func (*File) Size

func (f *File) Size() (int64, error)

Size returns the size of the file

func (*File) Sync

func (f *File) Sync() error

Synchronize a file on storage

Any pending writes are written out to storage. Returns a negative error code on failure.

func (*File) Write

func (f *File) Write(buf []byte) (n int, err error)

type FileAttr

type FileAttr byte

type FileResult

type FileResult uint

func (FileResult) Error

func (r FileResult) Error() string

type Info

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

func (*Info) IsDir

func (info *Info) IsDir() bool

func (*Info) ModTime

func (info *Info) ModTime() time.Time

func (*Info) Mode

func (info *Info) Mode() os.FileMode

func (*Info) Name

func (info *Info) Name() string

func (*Info) Size

func (info *Info) Size() int64

func (*Info) Sys

func (info *Info) Sys() interface{}

type OpenFlag

type OpenFlag uint

type Type

type Type uint

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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