dirfs

package
v0.24.13 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	*wrapfs.FS
	// contains filtered or unexported fields
}

func New

func New(dir path.Local, opts ...Option) (ofs *FS, err error)

func NewFromSystem

func NewFromSystem(dir string) (ofs *FS, err error)

func (*FS) Delete

func (d *FS) Delete(p path.Relative, recursive bool) (err error)

func (*FS) Drive

func (d *FS) Drive(p path.Relative) (path.Local, error)

func (*FS) FreeSpace

func (d *FS) FreeSpace(p path.Relative) int64

func (*FS) Move

func (d *FS) Move(src path.Relative, trgDir path.Relative) error

Move should return an error, if - the src does not exist - src is a directory and moving of directories is not supported by the fs - the resulting path trgDir.Join(path.Name(src)) does already exist - src and trgdir have different mountpoints

func (*FS) ReadSeeker

func (fsys *FS) ReadSeeker(p path.Relative) (fs.ReadSeekCloser, error)

func (*FS) Rename

func (d *FS) Rename(old path.Relative, newName string) error

Rename renames a file RenameFile renames a file. It is not allowed for directories and will also not move files, if the target is a directory. Renaming will fail, if there exists already a file under this name. Renaming will also fail, if the new file path is in a different directory should fail when the new name is not a name but a path

func (FS) Scheme added in v0.22.6

func (fsys FS) Scheme() string

func (*FS) SetMode

func (d *FS) SetMode(name path.Relative, m fs.FileMode) error

func (*FS) URLInit added in v0.22.6

func (fsys *FS) URLInit(u *url.URL) (rel path.Relative, err error)

func (*FS) Write

func (d *FS) Write(name path.Relative, data io.ReadCloser, recursive bool) error

func (*FS) WriteSeeker added in v0.21.0

func (fsys *FS) WriteSeeker(p path.Relative) (fs.WriteSeekCloser, error)

func (*FS) WriteWithMode

func (d *FS) WriteWithMode(p path.Relative, rd io.ReadCloser, perm fs.FileMode, recursive bool) (err error)

WriteWithMode reads from the given reader and writes all the content to the file of the given path. If the file already exists, if will be overwritten. Otherwise the file is newly created If name is a directory, data is ignored and the directory is created. If the directory is already there, nothing happens

type Option

type Option func(*FS)

func OptMkRoot

func OptMkRoot() Option

Jump to

Keyboard shortcuts

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