Documentation
¶
Index ¶
- func ClearDir(dir path.Local) error
- func CreateFile(f path.Local, bt []byte) error
- func CreateFileFrom(f path.Local, rd io.Reader) error
- func Delete(p path.Local, recursive bool) error
- func DirSize(dir path.Local) (size int64)
- func Drive(p path.Local, recursive bool) (path.Local, error)
- func Exists(p path.Local) bool
- func FreeSpace(p path.Local) int64
- func GetMode(p path.Local) (fs.FileMode, error)
- func Glob(pattern string) (matches []path.Local, err error)
- func IsEmpty(dir path.Local) bool
- func MkDir(p path.Local) error
- func MkDirAll(p path.Local) error
- func MkDirTmp(pattern string) (dir path.Local, err error)
- func ModTime(p path.Local) (time.Time, error)
- func Move(src path.Local, targetDir path.Local) error
- func MustPath(p string) (r path.Relative)
- func MustWD() (r path.Relative)
- func ParsePath(p string) (r path.Relative, err error)
- func ParseWD() (r path.Relative, err error)
- func ReadDirNames(dir path.Local) ([]string, error)
- func ReadDirPaths(dir path.Local) ([]path.Local, error)
- func ReadFile(f path.Local) ([]byte, error)
- func ReadSeeker(p path.Local) (fs.ReadSeekCloser, error)
- func Reader(p path.Local) (io.ReadCloser, error)
- func Rename(p path.Local, name string) error
- func SetMode(p path.Local, m fs.FileMode) error
- func Size(file path.Local) int64
- func Write(p path.Local, rd io.ReadCloser, inbetween bool) error
- func WriteFile(f path.Local, bt []byte, recursive bool) error
- func WriteFileFrom(f path.Local, rd io.Reader, recursive bool) error
- func WriteTmpFile(parentDir path.Local, pattern string, data []byte) (path.Local, error)
- func WriteWithMode(p path.Local, data io.ReadCloser, m fs.FileMode, recursive bool) error
- type FS
- func (fsys *FS) Abs(p path.Relative) path.Absolute
- func (fsys FS) Delete(p path.Relative, recursive bool) (err error)
- func (fsys FS) Drive(p path.Relative) (l path.Local, err error)
- func (fsys FS) Exists(p path.Relative) bool
- func (fsys FS) FreeSpace(r path.Relative) int64
- func (fsys FS) GetMode(p path.Relative) (m fs.FileMode, err error)
- func (fsys FS) Glob(pattern string) (matches []path.Relative, err error)
- func (fsys FS) MkDirTmp(parentDir path.Relative, pattern string) (dir path.Relative, err error)
- func (fsys FS) ModTime(p path.Relative) (t time.Time, err error)
- func (fsys FS) Move(src, trgtDir path.Relative) (err error)
- func (fsys FS) ReadSeeker(r path.Relative) (fs.ReadSeekCloser, error)
- func (fsys FS) Reader(p path.Relative) (io.ReadCloser, error)
- func (fsys FS) Rename(p path.Relative, name string) (err error)
- func (fsys FS) SetMode(p path.Relative, m fs.FileMode) (err error)
- func (fsys FS) Size(file path.Relative) int64
- func (fsys FS) Write(p path.Relative, rd io.ReadCloser, inbetween bool) (err error)
- func (fsys FS) WriteSeeker(r path.Relative) (fs.WriteSeekCloser, error)
- func (fsys FS) WriteTmpFile(parentDir path.Relative, pattern string, data []byte) (file path.Relative, err error)
- func (fsys FS) WriteWithMode(p path.Relative, data io.ReadCloser, m fs.FileMode, recursive bool) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶ added in v0.20.0
CreateFile does return an error, if the file already exists or if the parent directory does not exist
func DirSize ¶ added in v0.20.0
DirSize returns the size of the given directory. If the given path is not a directory or any error occurs, -1 is returned. If the given dir is empty, 0 is returned. TODO test
func IsEmpty ¶ added in v0.20.0
IsEmpty returns, if the given dir is empty or does not exist or is not a directory, but a file.
func MustPath ¶ added in v0.17.0
MustPath is like ParsePath, only that it panics, if the given path is not valid
func ParsePath ¶ added in v0.17.0
ParsePath parses an existing local path and returns a normalized path that is relative to rootfs the path might be absolute or relative (than it is relative to the current working directory) the given path must not end in a slash. if p must not be an empty string, or .
func ParseWD ¶ added in v0.17.0
ParseWD parses the working dir and returns a normalized path that is relative to rootfs
func ReadDirNames ¶ added in v0.20.0
ReadDirNames returns the names of the dirs and files in a directory and returns them
func ReadDirPaths ¶ added in v0.20.0
ReadDirPaths returns the full paths (including dir) of the files and folders inside dir
func ReadSeeker ¶ added in v0.20.0
func ReadSeeker(p path.Local) (fs.ReadSeekCloser, error)
func WriteFileFrom ¶ added in v0.20.0
func WriteTmpFile ¶ added in v0.20.0
func WriteWithMode ¶ added in v0.20.0
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func (FS) GetMode ¶ added in v0.17.0
should not return mode for a mountpoint (error (not implemented)), should return error (not implemented), if there is no fallback
func (FS) MkDirTmp ¶ added in v0.18.1
MkDirTmp creates a temporary directory inside the given parentDir if the parentDir is root, os.TempDir() is used as a parent, in each case the resulting dir must exist
func (FS) ReadSeeker ¶ added in v0.17.0
func (fsys FS) ReadSeeker(r path.Relative) (fs.ReadSeekCloser, error)
func (FS) WriteSeeker ¶ added in v0.21.0
func (fsys FS) WriteSeeker(r path.Relative) (fs.WriteSeekCloser, error)
func (FS) WriteTmpFile ¶ added in v0.18.1
func (fsys FS) WriteTmpFile(parentDir path.Relative, pattern string, data []byte) (file path.Relative, err error)
WriteTmpFile writes to a temporary file inside the given parentDir if the parentDir is root, os.TempDir() is used as a parent, in each case the resulting dir must exist