Documentation
¶
Index ¶
Constants ¶
View Source
const ( AttrReadOnly DirectoryAttr = 0x01 AttrHidden = 0x02 AttrSystem = 0x04 AttrVolumeId = 0x08 AttrDirectory = 0x10 AttrArchive = 0x20 AttrLongName = AttrReadOnly | AttrHidden | AttrSystem | AttrVolumeId )
View Source
const Version = "0.0.7"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDevice ¶
type BlockDevice interface {
// Closes this block device. No more methods may be called on a
// closed device.
Close() error
// Len returns the number of bytes in this block device.
Len() int64
// SectorSize returns the size of a single sector on this device.
SectorSize() int
// ReadAt reads data from the block device from the given
// offset. See io.ReaderAt for more information on this function.
ReadAt(p []byte, off int64) (n int, err error)
// WriteAt writes data to the block device at the given offset.
// See io.WriterAt for more information on this function.
WriteAt(p []byte, off int64) (n int, err error)
}
A BlockDevice is the raw device that is meant to store a filesystem.
type Directory ¶
type Directory interface {
Entry(name string) DirectoryEntry
Entries() []DirectoryEntry
AddDirectory(name string) (DirectoryEntry, error)
AddFile(name string) (DirectoryEntry, error)
}
Directory is an entry in a filesystem that stores files.
type DirectoryAttr ¶ added in v0.0.5
type DirectoryAttr uint8
type DirectoryEntry ¶
type DirectoryEntry interface {
Name() string
ShortName() string
IsDir() bool
Dir() (Directory, error)
File() (File, error)
IsVolumeId() bool
Attr() DirectoryAttr
SetAttr(DirectoryAttr, bool) error
}
DirectoryEntry represents a single entry within a directory, which can be either another Directory or a File.
type FileDisk ¶
type FileDisk struct {
// contains filtered or unexported fields
}
A FileDisk is an implementation of a BlockDevice that uses a *os.File as its backing store.
func NewFileDisk ¶
NewFileDisk creates a new FileDisk from the given *os.File. The file must already be created and set the to the proper size.
func (*FileDisk) SectorSize ¶
type FileSystem ¶
type FileSystem interface {
// RootDir returns the single root directory.
RootDir() (Directory, error)
Info() (map[string]any, error)
FATType() (int, error)
OEMName() (string, error)
VolumeLabel() (string, error)
}
A FileSystem provides access to a tree hierarchy of directories and files.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.