package afero

Import Path
	github.com/spf13/afero (on go.dev)

Dependency Relation
	imports 22 packages, and imported by one package


Package-Level Type Names (total 27, in which 21 are exported)
/* sort exporteds by: | */
Fs Fs Chmod changes the mode of the named file to mode. Chown changes the uid and gid of the named file. Chtimes changes the access and modification times of the named file Create creates a file in the filesystem, returning the file and an error, if any happens. ( T) DirExists(path string) (bool, error) ( T) Exists(path string) (bool, error) ( T) FileContainsAnyBytes(filename string, subslices [][]byte) (bool, error) ( T) FileContainsBytes(filename string, subslice []byte) (bool, error) ( T) GetTempDir(subPath string) string ( T) IsDir(path string) (bool, error) ( T) IsEmpty(path string) (bool, error) Mkdir creates a directory in the filesystem, return an error if any happens. MkdirAll creates a directory path and all parents that does not exist yet. The name of this FileSystem Open opens a file, returning it or an error, if any happens. OpenFile opens a file using the given flags and the given mode. ReadDir reads the directory named by dirname and returns a list of sorted directory entries. ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported. Remove removes a file identified by name, returning an error, if any happens. RemoveAll removes a directory path and any children it contains. It does not fail if the path does not exist (return nil). Rename renames a file. Same as WriteReader but checks to see if file/directory already exists. Stat returns a FileInfo describing the named file, or an error, if any happens. TempDir creates a new temporary directory in the directory dir with a name beginning with prefix and returns the path of the new directory. If dir is the empty string, TempDir uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempDir simultaneously will not choose the same directory. It is the caller's responsibility to remove the directory when no longer needed. TempFile creates a new temporary file in the directory dir, opens the file for reading and writing, and returns the resulting *os.File. The filename is generated by taking pattern and adding a random string to the end. If pattern includes a "*", the random string replaces the last "*". If dir is the empty string, TempFile uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed. ( T) Walk(root string, walkFn filepath.WalkFunc) error WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it with permissions perm; otherwise WriteFile truncates it before writing. Takes a reader and a path and writes the content T : Fs
File File ( T) Close() error (*T) Name() string ( T) Read(p []byte) (n int, err error) ( T) ReadAt(p []byte, off int64) (n int, err error) ( T) Readdir(count int) ([]os.FileInfo, error) ( T) Readdirnames(n int) ([]string, error) ( T) Seek(offset int64, whence int) (int64, error) ( T) Stat() (os.FileInfo, error) ( T) Sync() error ( T) Truncate(size int64) error ( T) Write(p []byte) (n int, err error) ( T) WriteAt(p []byte, off int64) (n int, err error) ( T) WriteString(s string) (ret int, err error) *T : File T : io.Closer T : io.ReadCloser T : io.Reader T : io.ReaderAt T : io.ReadSeekCloser T : io.ReadSeeker T : io.ReadWriteCloser T : io.ReadWriter T : io.ReadWriteSeeker T : io.Seeker T : io.StringWriter T : io.WriteCloser T : io.Writer T : io.WriterAt T : io.WriteSeeker T : io/fs.File T : mime/multipart.File T : net/http.File
The BasePathFs restricts all operations to a given path within an Fs. The given file name to the operations on this Fs will be prepended with the base path before calling the base Fs. Any file name (after filepath.Clean()) outside this base path will be treated as non existing file. Note that it does not clean the error messages on return, so you may reveal the real path on errors. (*T) Chmod(name string, mode os.FileMode) (err error) (*T) Chown(name string, uid, gid int) (err error) (*T) Chtimes(name string, atime, mtime time.Time) (err error) (*T) Create(name string) (f File, err error) (*T) LstatIfPossible(name string) (os.FileInfo, bool, error) (*T) Mkdir(name string, mode os.FileMode) (err error) (*T) MkdirAll(name string, mode os.FileMode) (err error) (*T) Name() string (*T) Open(name string) (f File, err error) (*T) OpenFile(name string, flag int, mode os.FileMode) (f File, err error) (*T) ReadlinkIfPossible(name string) (string, error) on a file outside the base path it returns the given file name and an error, else the given file with the base path prepended (*T) Remove(name string) (err error) (*T) RemoveAll(name string) (err error) (*T) Rename(oldname, newname string) (err error) (*T) Stat(name string) (fi os.FileInfo, err error) (*T) SymlinkIfPossible(oldname, newname string) error *T : Fs *T : Linker *T : LinkReader *T : Lstater *T : Symlinker func FullBaseFsPath(basePathFs *BasePathFs, relativePath string) string
If the cache duration is 0, cache time will be unlimited, i.e. once a file is in the layer, the base will never be read again for this file. For cache times greater than 0, the modification time of a file is checked. Note that a lot of file system implementations only allow a resolution of a second for timestamps... or as the godoc for os.Chtimes() states: "The underlying filesystem may truncate or round the values to a less precise time unit." This caching union will forward all write calls also to the base file system first. To prevent writing to the base Fs, wrap it in a read-only filter - Note: this will also make the overlay read-only, for writing files in the overlay, use the overlay Fs directly, not via the union Fs. (*T) Chmod(name string, mode os.FileMode) error (*T) Chown(name string, uid, gid int) error (*T) Chtimes(name string, atime, mtime time.Time) error (*T) Create(name string) (File, error) (*T) Mkdir(name string, perm os.FileMode) error (*T) MkdirAll(name string, perm os.FileMode) error (*T) Name() string (*T) Open(name string) (File, error) (*T) OpenFile(name string, flag int, perm os.FileMode) (File, error) (*T) Remove(name string) error (*T) RemoveAll(name string) error (*T) Rename(oldname, newname string) error (*T) Stat(name string) (os.FileInfo, error) *T : Fs
The CopyOnWriteFs is a union filesystem: a read only base file system with a possibly writeable layer on top. Changes to the file system will only be made in the overlay: Changing an existing file in the base layer which is not present in the overlay will copy the file to the overlay ("changing" includes also calls to e.g. Chtimes(), Chmod() and Chown()). Reading directories is currently only supported via Open(), not OpenFile(). (*T) Chmod(name string, mode os.FileMode) error (*T) Chown(name string, uid, gid int) error (*T) Chtimes(name string, atime, mtime time.Time) error (*T) Create(name string) (File, error) (*T) LstatIfPossible(name string) (os.FileInfo, bool, error) (*T) Mkdir(name string, perm os.FileMode) error (*T) MkdirAll(name string, perm os.FileMode) error (*T) Name() string This function handles the 9 different possibilities caused by the union which are the intersection of the following... layer: doesn't exist, exists as a file, and exists as a directory base: doesn't exist, exists as a file, and exists as a directory (*T) OpenFile(name string, flag int, perm os.FileMode) (File, error) (*T) ReadlinkIfPossible(name string) (string, error) Removing files present only in the base layer is not permitted. If a file is present in the base layer and the overlay, only the overlay will be removed. (*T) RemoveAll(name string) error Renaming files present only in the base layer is not permitted (*T) Stat(name string) (os.FileInfo, error) (*T) SymlinkIfPossible(oldname, newname string) error *T : Fs *T : Linker *T : LinkReader *T : Lstater *T : Symlinker
DirsMerger is how UnionFile weaves two directories together. It takes the FileInfo slices from the layer and the base and returns a single view.
File represents a file in the filesystem. ( T) Close() error ( T) Name() string ( T) Read(p []byte) (n int, err error) ( T) ReadAt(p []byte, off int64) (n int, err error) ( T) Readdir(count int) ([]os.FileInfo, error) ( T) Readdirnames(n int) ([]string, error) ( T) Seek(offset int64, whence int) (int64, error) ( T) Stat() (os.FileInfo, error) ( T) Sync() error ( T) Truncate(size int64) error ( T) Write(p []byte) (n int, err error) ( T) WriteAt(p []byte, off int64) (n int, err error) ( T) WriteString(s string) (ret int, err error) *BasePathFile *RegexpFile *UnionFile *github.com/spf13/afero/mem.File *os.File T : io.Closer T : io.ReadCloser T : io.Reader T : io.ReaderAt T : io.ReadSeekCloser T : io.ReadSeeker T : io.ReadWriteCloser T : io.ReadWriter T : io.ReadWriteSeeker T : io.Seeker T : io.StringWriter T : io.WriteCloser T : io.Writer T : io.WriterAt T : io.WriteSeeker T : io/fs.File T : mime/multipart.File T : net/http.File func TempFile(fs Fs, dir, pattern string) (f File, err error) func Afero.TempFile(dir, pattern string) (f File, err error) func (*BasePathFs).Create(name string) (f File, err error) func (*BasePathFs).Open(name string) (f File, err error) func (*BasePathFs).OpenFile(name string, flag int, mode os.FileMode) (f File, err error) func (*CacheOnReadFs).Create(name string) (File, error) func (*CacheOnReadFs).Open(name string) (File, error) func (*CacheOnReadFs).OpenFile(name string, flag int, perm os.FileMode) (File, error) func (*CopyOnWriteFs).Create(name string) (File, error) func (*CopyOnWriteFs).Open(name string) (File, error) func (*CopyOnWriteFs).OpenFile(name string, flag int, perm os.FileMode) (File, error) func FromIOFS.Create(name string) (File, error) func FromIOFS.Open(name string) (File, error) func FromIOFS.OpenFile(name string, flag int, perm os.FileMode) (File, error) func Fs.Create(name string) (File, error) func Fs.Open(name string) (File, error) func Fs.OpenFile(name string, flag int, perm os.FileMode) (File, error) func HttpFs.Create(name string) (File, error) func HttpFs.OpenFile(name string, flag int, perm os.FileMode) (File, error) func (*MemMapFs).Create(name string) (File, error) func (*MemMapFs).Open(name string) (File, error) func (*MemMapFs).OpenFile(name string, flag int, perm os.FileMode) (File, error) func OsFs.Create(name string) (File, error) func OsFs.Open(name string) (File, error) func OsFs.OpenFile(name string, flag int, perm os.FileMode) (File, error) func (*ReadOnlyFs).Create(n string) (File, error) func (*ReadOnlyFs).Open(n string) (File, error) func (*ReadOnlyFs).OpenFile(name string, flag int, perm os.FileMode) (File, error) func (*RegexpFs).Create(name string) (File, error) func (*RegexpFs).Open(name string) (File, error) func (*RegexpFs).OpenFile(name string, flag int, perm os.FileMode) (File, error)
FromIOFS adopts io/fs.FS to use it as afero.Fs Note that io/fs.FS is read-only so all mutating methods will return fs.PathError with fs.ErrPermission To store modifications you may use afero.CopyOnWriteFs FS fs.FS ( T) Chmod(name string, mode os.FileMode) error ( T) Chown(name string, uid, gid int) error ( T) Chtimes(name string, atime time.Time, mtime time.Time) error ( T) Create(name string) (File, error) ( T) Mkdir(name string, perm os.FileMode) error ( T) MkdirAll(path string, perm os.FileMode) error ( T) Name() string ( T) Open(name string) (File, error) ( T) OpenFile(name string, flag int, perm os.FileMode) (File, error) ( T) Remove(name string) error ( T) RemoveAll(path string) error ( T) Rename(oldname, newname string) error ( T) Stat(name string) (os.FileInfo, error) T : Fs
Fs is the filesystem interface. Any simulated or real filesystem should implement this interface. Chmod changes the mode of the named file to mode. Chown changes the uid and gid of the named file. Chtimes changes the access and modification times of the named file Create creates a file in the filesystem, returning the file and an error, if any happens. Mkdir creates a directory in the filesystem, return an error if any happens. MkdirAll creates a directory path and all parents that does not exist yet. The name of this FileSystem Open opens a file, returning it or an error, if any happens. OpenFile opens a file using the given flags and the given mode. Remove removes a file identified by name, returning an error, if any happens. RemoveAll removes a directory path and any children it contains. It does not fail if the path does not exist (return nil). Rename renames a file. Stat returns a FileInfo describing the named file, or an error, if any happens. Afero *BasePathFs *CacheOnReadFs *CopyOnWriteFs FromIOFS *MemMapFs OsFs *ReadOnlyFs *RegexpFs func NewBasePathFs(source Fs, path string) Fs func NewCacheOnReadFs(base Fs, layer Fs, cacheTime time.Duration) Fs func NewCopyOnWriteFs(base Fs, layer Fs) Fs func NewMemMapFs() Fs func NewOsFs() Fs func NewReadOnlyFs(source Fs) Fs func NewRegexpFs(source Fs, re *regexp.Regexp) Fs func DirExists(fs Fs, path string) (bool, error) func Exists(fs Fs, path string) (bool, error) func FileContainsAnyBytes(fs Fs, filename string, subslices [][]byte) (bool, error) func FileContainsBytes(fs Fs, filename string, subslice []byte) (bool, error) func GetTempDir(fs Fs, subPath string) string func Glob(fs Fs, pattern string) (matches []string, err error) func IsDir(fs Fs, path string) (bool, error) func IsEmpty(fs Fs, path string) (bool, error) func NewBasePathFs(source Fs, path string) Fs func NewCacheOnReadFs(base Fs, layer Fs, cacheTime time.Duration) Fs func NewCacheOnReadFs(base Fs, layer Fs, cacheTime time.Duration) Fs func NewCopyOnWriteFs(base Fs, layer Fs) Fs func NewCopyOnWriteFs(base Fs, layer Fs) Fs func NewHttpFs(source Fs) *HttpFs func NewIOFS(fs Fs) IOFS func NewReadOnlyFs(source Fs) Fs func NewRegexpFs(source Fs, re *regexp.Regexp) Fs func ReadDir(fs Fs, dirname string) ([]os.FileInfo, error) func ReadFile(fs Fs, filename string) ([]byte, error) func SafeWriteReader(fs Fs, path string, r io.Reader) (err error) func TempDir(fs Fs, dir, prefix string) (name string, err error) func TempFile(fs Fs, dir, pattern string) (f File, err error) func Walk(fs Fs, root string, walkFn filepath.WalkFunc) error func WriteFile(fs Fs, filename string, data []byte, perm os.FileMode) error func WriteReader(fs Fs, path string, r io.Reader) (err error) func github.com/spf13/viper.SetFs(fs Fs) func github.com/spf13/viper.(*Viper).SetFs(fs Fs)
( T) Chmod(name string, mode os.FileMode) error ( T) Chown(name string, uid, gid int) error ( T) Chtimes(name string, atime time.Time, mtime time.Time) error ( T) Create(name string) (File, error) ( T) Dir(s string) *httpDir ( T) Mkdir(name string, perm os.FileMode) error ( T) MkdirAll(path string, perm os.FileMode) error ( T) Name() string ( T) Open(name string) (http.File, error) ( T) OpenFile(name string, flag int, perm os.FileMode) (File, error) ( T) Remove(name string) error ( T) RemoveAll(path string) error ( T) Rename(oldname, newname string) error ( T) Stat(name string) (os.FileInfo, error) T : net/http.FileSystem func NewHttpFs(source Fs) *HttpFs
IOFS adopts afero.Fs to stdlib io/fs.FS Fs Fs Chmod changes the mode of the named file to mode. Chown changes the uid and gid of the named file. Chtimes changes the access and modification times of the named file Create creates a file in the filesystem, returning the file and an error, if any happens. ( T) Glob(pattern string) ([]string, error) Mkdir creates a directory in the filesystem, return an error if any happens. MkdirAll creates a directory path and all parents that does not exist yet. The name of this FileSystem ( T) Open(name string) (fs.File, error) OpenFile opens a file using the given flags and the given mode. ( T) ReadDir(name string) ([]fs.DirEntry, error) ( T) ReadFile(name string) ([]byte, error) Remove removes a file identified by name, returning an error, if any happens. RemoveAll removes a directory path and any children it contains. It does not fail if the path does not exist (return nil). Rename renames a file. Stat returns a FileInfo describing the named file, or an error, if any happens. ( T) Sub(dir string) (fs.FS, error) T : io/fs.FS T : io/fs.GlobFS T : io/fs.ReadDirFS T : io/fs.ReadFileFS T : io/fs.StatFS T : io/fs.SubFS func NewIOFS(fs Fs) IOFS
Linker is an optional interface in Afero. It is only implemented by the filesystems saying so. It will call Symlink if the filesystem itself is, or it delegates to, the os filesystem, or the filesystem otherwise supports Symlink's. ( T) SymlinkIfPossible(oldname, newname string) error *BasePathFs *CopyOnWriteFs OsFs *ReadOnlyFs Symlinker (interface)
LinkReader is an optional interface in Afero. It is only implemented by the filesystems saying so. ( T) ReadlinkIfPossible(name string) (string, error) *BasePathFs *CopyOnWriteFs OsFs *ReadOnlyFs Symlinker (interface)
Lstater is an optional interface in Afero. It is only implemented by the filesystems saying so. It will call Lstat if the filesystem iself is, or it delegates to, the os filesystem. Else it will call Stat. In addtion to the FileInfo, it will return a boolean telling whether Lstat was called or not. ( T) LstatIfPossible(name string) (os.FileInfo, bool, error) *BasePathFs *CopyOnWriteFs *MemMapFs OsFs *ReadOnlyFs Symlinker (interface)
(*T) Chmod(name string, mode os.FileMode) error (*T) Chown(name string, uid, gid int) error (*T) Chtimes(name string, atime time.Time, mtime time.Time) error (*T) Create(name string) (File, error) (*T) List() (*T) LstatIfPossible(name string) (os.FileInfo, bool, error) (*T) Mkdir(name string, perm os.FileMode) error (*T) MkdirAll(path string, perm os.FileMode) error (*T) Name() string (*T) Open(name string) (File, error) (*T) OpenFile(name string, flag int, perm os.FileMode) (File, error) (*T) Remove(name string) error (*T) RemoveAll(path string) error (*T) Rename(oldname, newname string) error (*T) Stat(name string) (os.FileInfo, error) *T : Fs *T : Lstater
OsFs is a Fs implementation that uses functions provided by the os package. For details in any method, check the documentation of the os package (http://golang.org/pkg/os/). ( T) Chmod(name string, mode os.FileMode) error ( T) Chown(name string, uid, gid int) error ( T) Chtimes(name string, atime time.Time, mtime time.Time) error ( T) Create(name string) (File, error) ( T) LstatIfPossible(name string) (os.FileInfo, bool, error) ( T) Mkdir(name string, perm os.FileMode) error ( T) MkdirAll(path string, perm os.FileMode) error ( T) Name() string ( T) Open(name string) (File, error) ( T) OpenFile(name string, flag int, perm os.FileMode) (File, error) ( T) ReadlinkIfPossible(name string) (string, error) ( T) Remove(name string) error ( T) RemoveAll(path string) error ( T) Rename(oldname, newname string) error ( T) Stat(name string) (os.FileInfo, error) ( T) SymlinkIfPossible(oldname, newname string) error T : Fs T : Linker T : LinkReader T : Lstater T : Symlinker
(*T) Chmod(n string, m os.FileMode) error (*T) Chown(n string, uid, gid int) error (*T) Chtimes(n string, a, m time.Time) error (*T) Create(n string) (File, error) (*T) LstatIfPossible(name string) (os.FileInfo, bool, error) (*T) Mkdir(n string, p os.FileMode) error (*T) MkdirAll(n string, p os.FileMode) error (*T) Name() string (*T) Open(n string) (File, error) (*T) OpenFile(name string, flag int, perm os.FileMode) (File, error) (*T) ReadDir(name string) ([]os.FileInfo, error) (*T) ReadlinkIfPossible(name string) (string, error) (*T) Remove(n string) error (*T) RemoveAll(p string) error (*T) Rename(o, n string) error (*T) Stat(name string) (os.FileInfo, error) (*T) SymlinkIfPossible(oldname, newname string) error *T : Fs *T : Linker *T : LinkReader *T : Lstater *T : Symlinker
(*T) Close() error (*T) Name() string (*T) Read(s []byte) (int, error) (*T) ReadAt(s []byte, o int64) (int, error) (*T) Readdir(c int) (fi []os.FileInfo, err error) (*T) Readdirnames(c int) (n []string, err error) (*T) Seek(o int64, w int) (int64, error) (*T) Stat() (os.FileInfo, error) (*T) Sync() error (*T) Truncate(s int64) error (*T) Write(s []byte) (int, error) (*T) WriteAt(s []byte, o int64) (int, error) (*T) WriteString(s string) (int, error) *T : File *T : io.Closer *T : io.ReadCloser *T : io.Reader *T : io.ReaderAt *T : io.ReadSeekCloser *T : io.ReadSeeker *T : io.ReadWriteCloser *T : io.ReadWriter *T : io.ReadWriteSeeker *T : io.Seeker *T : io.StringWriter *T : io.WriteCloser *T : io.Writer *T : io.WriterAt *T : io.WriteSeeker *T : io/fs.File *T : mime/multipart.File *T : net/http.File
The RegexpFs filters files (not directories) by regular expression. Only files matching the given regexp will be allowed, all others get a ENOENT error ( "No such file or directory"). (*T) Chmod(name string, mode os.FileMode) error (*T) Chown(name string, uid, gid int) error (*T) Chtimes(name string, a, m time.Time) error (*T) Create(name string) (File, error) (*T) Mkdir(n string, p os.FileMode) error (*T) MkdirAll(n string, p os.FileMode) error (*T) Name() string (*T) Open(name string) (File, error) (*T) OpenFile(name string, flag int, perm os.FileMode) (File, error) (*T) Remove(name string) error (*T) RemoveAll(p string) error (*T) Rename(oldname, newname string) error (*T) Stat(name string) (os.FileInfo, error) *T : Fs
Symlinker is an optional interface in Afero. It is only implemented by the filesystems saying so. It indicates support for 3 symlink related interfaces that implement the behaviors of the os methods: - Lstat - Symlink, and - Readlink ( T) LstatIfPossible(name string) (os.FileInfo, bool, error) ( T) ReadlinkIfPossible(name string) (string, error) ( T) SymlinkIfPossible(oldname, newname string) error *BasePathFs *CopyOnWriteFs OsFs *ReadOnlyFs T : Linker T : LinkReader T : Lstater
The UnionFile implements the afero.File interface and will be returned when reading a directory present at least in the overlay or opening a file for writing. The calls to Readdir() and Readdirnames() merge the file os.FileInfo / names from the base and the overlay - for files present in both layers, only those from the overlay will be used. When opening files for writing (Create() / OpenFile() with the right flags) the operations will be done in both layers, starting with the overlay. A successful read in the overlay will move the cursor position in the base layer by the number of bytes read. Base File Layer File Merger DirsMerger (*T) Close() error (*T) Name() string (*T) Read(s []byte) (int, error) (*T) ReadAt(s []byte, o int64) (int, error) Readdir will weave the two directories together and return a single view of the overlayed directories. At the end of the directory view, the error is io.EOF if c > 0. (*T) Readdirnames(c int) ([]string, error) (*T) Seek(o int64, w int) (pos int64, err error) (*T) Stat() (os.FileInfo, error) (*T) Sync() (err error) (*T) Truncate(s int64) (err error) (*T) Write(s []byte) (n int, err error) (*T) WriteAt(s []byte, o int64) (n int, err error) (*T) WriteString(s string) (n int, err error) *T : File *T : io.Closer *T : io.ReadCloser *T : io.Reader *T : io.ReaderAt *T : io.ReadSeekCloser *T : io.ReadSeeker *T : io.ReadWriteCloser *T : io.ReadWriter *T : io.ReadWriteSeeker *T : io.Seeker *T : io.StringWriter *T : io.WriteCloser *T : io.Writer *T : io.WriterAt *T : io.WriteSeeker *T : io/fs.File *T : mime/multipart.File *T : net/http.File
Package-Level Functions (total 43, in which 29 are exported)
DirExists checks if a path exists and is a directory.
Check if a file or directory exists.
Check if a file contains any of the specified byte slices.
Check if a file contains a specified byte slice.
func FullBaseFsPath(basePathFs *BasePathFs, relativePath string) string
GetTempDir returns the default temp directory with trailing slash if subPath is not empty then it will be created recursively with mode 777 rwx rwx rwx
Glob returns the names of all files matching pattern or nil if there is no matching file. The syntax of patterns is the same as in Match. The pattern may describe hierarchical names such as /usr/*/bin/ed (assuming the Separator is '/'). Glob ignores file system errors such as I/O errors reading directories. The only possible returned error is ErrBadPattern, when pattern is malformed. This was adapted from (http://golang.org/pkg/path/filepath) and uses several built-ins from that package.
IsDir checks if a given path is a directory.
IsEmpty checks if a given file or directory is empty.
Transform characters with accents into plain forms.
func NewBasePathFs(source Fs, path string) Fs
func NewCacheOnReadFs(base Fs, layer Fs, cacheTime time.Duration) Fs
func NewCopyOnWriteFs(base Fs, layer Fs) Fs
func NewHttpFs(source Fs) *HttpFs
func NewIOFS(fs Fs) IOFS
func NewMemMapFs() Fs
func NewOsFs() Fs
func NewReadOnlyFs(source Fs) Fs
func NewRegexpFs(source Fs, re *regexp.Regexp) Fs
ReadAll reads from r until an error or EOF and returns the data it read. A successful call returns err == nil, not err == EOF. Because ReadAll is defined to read from src until EOF, it does not treat an EOF from Read as an error to be reported.
func ReadDir(fs Fs, dirname string) ([]os.FileInfo, error)
func ReadFile(fs Fs, filename string) ([]byte, error)
func SafeWriteReader(fs Fs, path string, r io.Reader) (err error)
func TempDir(fs Fs, dir, prefix string) (name string, err error)
func TempFile(fs Fs, dir, pattern string) (f File, err error)
Rewrite string to remove non-standard path characters
func Walk(fs Fs, root string, walkFn filepath.WalkFunc) error
func WriteFile(fs Fs, filename string, data []byte, perm os.FileMode) error
func WriteReader(fs Fs, path string, r io.Reader) (err error)
Package-Level Variables (total 11, in which 8 are exported)
Package-Level Constants (total 7, in which 2 are exported)
const BADFD syscall.Errno = 77
Filepath separator defined by os.Separator.