filesystem

package
v0.0.0-...-199b158 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	O_RDONLY = FileFlag(os.O_RDONLY)
	O_WRONLY = FileFlag(os.O_WRONLY)
	O_RDWR   = FileFlag(os.O_RDWR)
	O_APPEND = FileFlag(os.O_APPEND)
	O_CREATE = FileFlag(os.O_CREATE)
	O_EXCL   = FileFlag(os.O_EXCL)
	O_SYNC   = FileFlag(os.O_SYNC)
	O_TRUNC  = FileFlag(os.O_TRUNC)
)

Variables

This section is empty.

Functions

func Open

func Open(f FS, name string) (fs.File, error)

Types

type ControlFile

type ControlFile interface {
	File
	Control(op int, arg any) error
}

type Dir

type Dir interface {
	DirFile
	OpenFile(name string, flag FileFlag, perm fs.FileMode) (File, error)
	Mkdir(name string, perm fs.FileMode) error
}

type DirFS

type DirFS interface {
	FS
	ReadDir(name string) ([]fs.DirEntry, error)
	Mkdir(name string, perm fs.FileMode) (DirFS, error)
}

func SysDirFS

func SysDirFS(dir string) DirFS

type DirFile

type DirFile interface {
	File
	ReadDir(n int) ([]fs.DirEntry, error)
}

type FS

type FS interface {
	fs.FS
	OpenFile(name string, flag FileFlag, perm fs.FileMode) (File, error)
}
func SoftLink(name string, fs FS) FS

func SysFileFS

func SysFileFS(name string) FS

type File

type File interface {
	Close() error
	Stat() (fs.FileInfo, error)
}

type FileFlag

type FileFlag int

type ReadFile

type ReadFile interface {
	File
	Read(b []byte) (n int, err error)
}

type ReadlinkDir

type ReadlinkDir interface {
	DirFile
	Readlink(name string) (string, error)
}

type ReadlinkFS

type ReadlinkFS interface {
	DirFS
	Readlink(name string) (string, error)
}

type VirtualFS

type VirtualFS interface {
	ReadlinkFS
	Link(name string, handle FS) error
}

func NewVirtualFS

func NewVirtualFS() VirtualFS

type WriteFile

type WriteFile interface {
	File
	Write(b []byte) (n int, err error)
}

Jump to

Keyboard shortcuts

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