Documentation ¶
Index ¶
- type FS
- func (fs FS) FileExists(file string) bool
- func (FS) Getwd() (string, error)
- func (fs FS) IsDirectory(path string) bool
- func (FS) Mkdir(path string, perm fs.FileMode) error
- func (FS) MkdirAll(path string, perm fs.FileMode) error
- func (FS) Open(name string) (fs.File, error)
- func (FS) OpenFile(path string, flag int, perm fs.FileMode) (io.ReadWriteCloser, error)
- func (FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (FS) Remove(path string) error
- func (FS) RemoveAll(path string) error
- func (FS) Stat(name string) (fs.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct{}
FS implementation of `fsutil.FS` for the local OS file system.
func (FS) FileExists ¶
FileExists returns true if the file at the given path exists and is readable. Returns false if the given file is a directory.
func (FS) Getwd ¶
Getwd returns a rooted path name corresponding to the current directory. If the current directory can be reached via multiple paths (due to symbolic links), Getwd may return any one of them.
func (FS) IsDirectory ¶
IsDirectory returns true if the file at the given path exists, is a directory and is readable.
func (FS) Mkdir ¶
Mkdir creates a new directory with the specified name and permission bits (before umask). If there is an error, it will be of type `*PathError`.
func (FS) MkdirAll ¶
MkdirAll creates a directory named path, along with any necessary parents, and returns `nil`, or else returns an error. The permission bits perm (before umask) are used for all directories that `MkdirAll` creates. If path is already a directory, `MkdirAll` does nothing and returns `nil`.
func (FS) Open ¶
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode `O_RDONLY`. If there is an error, it will be of type `*PathError“.
func (FS) OpenFile ¶
OpenFile is the generalized open call. It opens the named file with specified flag (`O_RDONLY` etc.). If the file does not exist, and the `O_CREATE` flag is passed, it is created with mode perm (before umask). If successful, methods on the returned file can be used for I/O. If there is an error, it will be of type `*PathError`.
func (FS) ReadDir ¶
ReadDir reads the named directory, returning all its directory entries sorted by filename. If an error occurs reading the directory, ReadDir returns the entries it was able to read before the error, along with the error.
func (FS) Remove ¶
Remove removes the named file or (empty) directory. If there is an error, it will be of type `*PathError`.