Documentation
¶
Index ¶
- Variables
- func Chtimes(fsys fs.FS, name string, atime, mtime time.Time) error
- func FullFilePath(fsys fs.FS, name string) (string, error)
- func Lstat(fsys fs.FS, name string) (fs.FileInfo, error)
- func ReadLink(fsys fs.FS, name string) (string, error)
- func Remove(fsys fs.FS, name string) error
- func RemoveAll(fsys fs.FS, name string) error
- func WriteFile(fsys fs.FS, name string, data []byte, perm fs.FileMode) (retErr error)
- type ChtimesFS
- type FS
- type File
- type FileFilter
- type FullFilePathFS
- type LstatFS
- type ReadLinkFS
- type RemoveAllFS
- type RemoveFS
- type WriteFS
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotImplemented is returned when the file system does not implement an operation ErrNotImplemented errNotImplemented // ErrTargetOutsideFS is returned when the symlink target is outside the file system ErrTargetOutsideFS errTargetOutsideFS )
var ErrFileMasked errFileMasked
ErrFileMasked is returned when the file is masked
var ErrReadOnly errReadOnly
ErrReadOnly is returned when the file is read only
Functions ¶
func FullFilePath ¶ added in v0.1.3
FullFilePath returns the underlying file path of the named file
If fsys does not implement FullFilePathFS, then FullFilePath returns an error.
func Lstat ¶
Lstat returns the FileInfo of the named file without following symbolic links
If fsys does not implement LstatFS, then Lstat returns an error.
func ReadLink ¶
ReadLink returns the destination of the named symbolic link.
If fsys does not implement ReadLinkFS, then ReadLink returns an error.
Types ¶
type ChtimesFS ¶ added in v0.1.2
type ChtimesFS interface { fs.FS // Remove removes a file Chtimes(name string, atime, mtime time.Time) error }
ChtimesFS is a file system that may change file time metadata
type FS ¶
type FS interface { fs.FS fs.StatFS fs.ReadDirFS fs.ReadFileFS fs.GlobFS fs.SubFS FullFilePathFS LstatFS ReadLinkFS WriteFS RemoveFS RemoveAllFS ChtimesFS }
FS implements all the file system operations
type FileFilter ¶
FileFilter filters files by file path and dir entry
type FullFilePathFS ¶ added in v0.1.3
type FullFilePathFS interface { fs.FS // FullFilePath returns the underlying file path for a given file name // // This is intended to serve as an escape hatch for supporting operations // that are not generic enough to be handled by a more generic fs FullFilePath(name string) (string, error) }
LstatFS is a file system that can run lstat
type LstatFS ¶
type LstatFS interface { fs.FS // Lstat returns the FileInfo of the named file without following symbolic // links Lstat(name string) (fs.FileInfo, error) }
LstatFS is a file system that can run lstat
type ReadLinkFS ¶
type ReadLinkFS interface { fs.FS // ReadLink returns the destination of the named symbolic link. Link // destinations will always be slash-separated paths relative to the link's // directory. The link destination is guaranteed to be a path inside FS. ReadLink(name string) (string, error) }
ReadLinkFS is a file system that can read links
type RemoveAllFS ¶
type RemoveAllFS interface { fs.FS // RemoveAll removes a file and all children RemoveAll(name string) error }
RemoveAllFS is a file system that may remove files and their children