Documentation
¶
Index ¶
- Variables
- func Join(parts ...string) string
- func Register(f Factory)
- func Split(path string) []string
- type ContentFile
- func (f *ContentFile) Close() error
- func (f *ContentFile) OnClose(fn func() error) *ContentFile
- func (f *ContentFile) Read(p []byte) (int, error)
- func (f *ContentFile) ReadAt(p []byte, off int64) (int, error)
- func (f *ContentFile) Seek(offset int64, whence int) (int64, error)
- func (f *ContentFile) Write(p []byte) (int, error)
- func (f *ContentFile) WriteAt(p []byte, off int64) (int, error)
- type FS
- type Factory
- type File
- type FileInfo
- type Fork
- type FourCC
- type IOFS
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrReadOnly = errors.New("hfsgo/vfs: file system is read-only") ErrNotExist = fs.ErrNotExist ErrExist = fs.ErrExist ErrNotDir = errors.New("hfsgo/vfs: not a directory") ErrIsDir = errors.New("hfsgo/vfs: is a directory") ErrJournaled = errors.New("hfsgo/vfs: refusing to write a journaled HFS+ volume") ErrUnsupported = errors.New("hfsgo/vfs: unsupported operation") )
Functions ¶
Types ¶
type ContentFile ¶
type ContentFile struct {
// contains filtered or unexported fields
}
ContentFile is the shared File implementation over disk.Content. Classic HFS and HFS+ both mount through vfs.FS; forks should be Content windows on the volume, not a separate I/O stack.
func NewContentFile ¶
func NewContentFile(c disk.Content, writable bool) *ContentFile
NewContentFile wraps c as a seekable fork. writable controls Write/WriteAt.
func (*ContentFile) Close ¶
func (f *ContentFile) Close() error
func (*ContentFile) OnClose ¶
func (f *ContentFile) OnClose(fn func() error) *ContentFile
OnClose sets an optional flush invoked from Close. Returns f for chaining.
type FS ¶
type FS interface {
io.Closer
Name() string
VolumeLabel() string
CanWrite() bool
Stat(path string) (FileInfo, error)
ReadDir(path string) ([]FileInfo, error)
OpenFile(path string, fork Fork, flag int) (File, error)
CreateFile(path string) error
CreateDir(path string) error
Remove(path string) error
Rename(oldpath, newpath string) error
MkdirAll(path string) error
SetInfo(path string, info FileInfo) error
}
FS is the Mac-aware file system interface (DiscUtils IFileSystem + forks).
type Factory ¶
type Factory interface {
Name() string
Detect(c disk.Content) bool
Mount(c disk.Content, writable bool) (FS, error)
}
Factory detects and mounts a file system on a volume.
type FileInfo ¶
type FileInfo struct {
Name string
IsDir bool
Size int64
RsrcSize int64
CNID uint32
Type FourCC
Creator FourCC
Created time.Time
Modified time.Time
Accessed time.Time
Flags uint16
}
FileInfo is Mac-native metadata.
Click to show internal directories.
Click to hide internal directories.