Documentation
¶
Index ¶
- Constants
- type File
- func (f *File) CreationTime() time.Time
- func (f *File) HeaderAddr() uint32
- func (f *File) Name() string
- func (f *File) ReadAt(pos uint32, l uint32) ([]byte, error)
- func (f *File) Register() error
- func (f *File) SetName(name string)
- func (f *File) Size() uint32
- func (f *File) Unregister() error
- func (f *File) WriteAt(pos uint32, data []byte) error
- type FileSystem
- func (fs *FileSystem) AllocSector(hint uint32) uint32
- func (fs *FileSystem) Close() error
- func (fs *FileSystem) Find(name string) (*File, error)
- func (fs *FileSystem) FreeSector(addr uint32)
- func (fs *FileSystem) Insert(f *File) error
- func (fs *FileSystem) IsSectorFree(addr uint32) bool
- func (fs *FileSystem) ListFiles(pred ListFileFilter) ([]*File, error)
- func (fs *FileSystem) NewFile(name string) (*File, error)
- func (fs *FileSystem) NewFileFromFileHeader(headerAddr uint32) (*File, error)
- func (fs *FileSystem) Remove(name string) bool
- type ListFileFilter
Constants ¶
View Source
const (
N = dirPgSize / 2
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) CreationTime ¶
func (*File) HeaderAddr ¶
func (*File) Unregister ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func New ¶
func New(d *disk.Disk) *FileSystem
func (*FileSystem) AllocSector ¶
func (fs *FileSystem) AllocSector(hint uint32) uint32
AllocSector allocates a new sector. "hint" can be previously allocated sector to preserve adjacency, or 0 if previous sector not known.
func (*FileSystem) Close ¶
func (fs *FileSystem) Close() error
func (*FileSystem) FreeSector ¶
func (fs *FileSystem) FreeSector(addr uint32)
func (*FileSystem) Insert ¶
func (fs *FileSystem) Insert(f *File) error
func (*FileSystem) IsSectorFree ¶
func (fs *FileSystem) IsSectorFree(addr uint32) bool
func (*FileSystem) ListFiles ¶
func (fs *FileSystem) ListFiles(pred ListFileFilter) ([]*File, error)
func (*FileSystem) NewFileFromFileHeader ¶
func (fs *FileSystem) NewFileFromFileHeader(headerAddr uint32) (*File, error)
func (*FileSystem) Remove ¶
func (fs *FileSystem) Remove(name string) bool
type ListFileFilter ¶
var AllFiles ListFileFilter = func(f *File) bool { return true }
Click to show internal directories.
Click to hide internal directories.