filesystem

package
v0.0.0-...-9933e25 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 (f *File) CreationTime() time.Time

func (*File) HeaderAddr

func (f *File) HeaderAddr() uint32

func (*File) Name

func (f *File) Name() string

func (*File) ReadAt

func (f *File) ReadAt(pos uint32, l uint32) ([]byte, error)

func (*File) Register

func (f *File) Register() error

func (*File) SetName

func (f *File) SetName(name string)

func (*File) Size

func (f *File) Size() uint32

func (*File) Unregister

func (f *File) Unregister() error

func (*File) WriteAt

func (f *File) WriteAt(pos uint32, data []byte) error

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

func (fs *FileSystem) Find(name string) (*File, 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) NewFile

func (fs *FileSystem) NewFile(name string) (*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

type ListFileFilter func(*File) bool
var AllFiles ListFileFilter = func(f *File) bool {
	return true
}

Jump to

Keyboard shortcuts

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