fs

package
v0.0.0-...-f5de9ae Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDir = interop.NewError("not a directory", "ENOTDIR")
)

Functions

func DestroyMount

func DestroyMount(path string) error

func Dump

func Dump(basePath string) interface{}

Dump prints out file system statistics

func Mounts

func Mounts() []mount.Point

func NewFileDescriptor

func NewFileDescriptor(fid FID, absPath string, flags int, mode os.FileMode) (*fileDescriptor, error)

func Overlay

func Overlay(mountPath string, fs hackpadfs.FS) error

func OverlayTarGzip

func OverlayTarGzip(mountPath string, gzipReader io.ReadCloser, persist bool, shouldCache ShouldCacher) error

Types

type Attr

type Attr struct {
	Ignore bool
	Pipe   bool
	FID    FID
}

Attr defines file descriptor inheritance rules for a new set of descriptors Ignore is unsupported. Pipe will create a new pipe and attach it to the child process. FID will inherit that descriptor in the child process.

type FID

type FID = common.FID

type FileDescriptors

type FileDescriptors struct {
	// contains filtered or unexported fields
}

func NewFileDescriptors

func NewFileDescriptors(parentPID common.PID, workingDirectory string, parentFiles *FileDescriptors, inheritFDs []Attr) (*FileDescriptors, func(wd string) error, error)

func NewStdFileDescriptors

func NewStdFileDescriptors(parentPID common.PID, workingDirectory string) (*FileDescriptors, error)

func (*FileDescriptors) Chmod

func (f *FileDescriptors) Chmod(path string, mode os.FileMode) error

func (*FileDescriptors) Close

func (f *FileDescriptors) Close(fd FID) error

func (*FileDescriptors) CloseAll

func (f *FileDescriptors) CloseAll()

func (*FileDescriptors) Fchmod

func (f *FileDescriptors) Fchmod(fd FID, mode os.FileMode) error

func (*FileDescriptors) Flock

func (f *FileDescriptors) Flock(fd FID, action LockAction) error

func (*FileDescriptors) Fstat

func (f *FileDescriptors) Fstat(fd FID) (os.FileInfo, error)

func (*FileDescriptors) Fsync

func (f *FileDescriptors) Fsync(fd FID) error

func (*FileDescriptors) Lstat

func (f *FileDescriptors) Lstat(path string) (os.FileInfo, error)

func (*FileDescriptors) Mkdir

func (f *FileDescriptors) Mkdir(path string, mode os.FileMode) error

func (*FileDescriptors) MkdirAll

func (f *FileDescriptors) MkdirAll(path string, mode os.FileMode) error

func (*FileDescriptors) Open

func (f *FileDescriptors) Open(path string, flags int, mode os.FileMode) (fd FID, err error)

func (*FileDescriptors) Pipe

func (f *FileDescriptors) Pipe() [2]FID

func (*FileDescriptors) RawFID

func (f *FileDescriptors) RawFID(fid FID) (io.Reader, error)

func (*FileDescriptors) RawFIDs

func (f *FileDescriptors) RawFIDs() []io.Reader

func (*FileDescriptors) Read

func (f *FileDescriptors) Read(fd FID, buffer blob.Blob, offset, length int, position *int64) (n int, err error)

func (*FileDescriptors) ReadDir

func (f *FileDescriptors) ReadDir(path string) ([]hackpadfs.DirEntry, error)

func (*FileDescriptors) ReadFile

func (f *FileDescriptors) ReadFile(path string) (blob.Blob, error)

func (*FileDescriptors) RemoveDir

func (f *FileDescriptors) RemoveDir(path string) error

func (*FileDescriptors) Rename

func (f *FileDescriptors) Rename(oldPath, newPath string) error

func (*FileDescriptors) Stat

func (f *FileDescriptors) Stat(path string) (os.FileInfo, error)

func (*FileDescriptors) String

func (f *FileDescriptors) String() string

func (*FileDescriptors) Truncate

func (f *FileDescriptors) Truncate(fd FID, length int64) error
func (f *FileDescriptors) Unlink(path string) error

func (*FileDescriptors) Utimes

func (f *FileDescriptors) Utimes(path string, atime, mtime time.Time) error

func (*FileDescriptors) WorkingDirectory

func (f *FileDescriptors) WorkingDirectory() string

func (*FileDescriptors) Write

func (f *FileDescriptors) Write(fd FID, buffer blob.Blob, offset, length int, position *int64) (n int, err error)

type LockAction

type LockAction int
const (
	LockShared LockAction = iota
	LockExclusive
	Unlock
)

type ShouldCacher

type ShouldCacher func(name string, info hackpadfs.FileInfo) bool

Jump to

Keyboard shortcuts

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