Versions in this module Expand all Collapse all v1 v1.0.0 Apr 17, 2021 Changes in this version + const BADFD + const FilePathSeparator + var ErrDestinationExists = os.ErrExist + var ErrFileClosed = errors.New("File is closed") + var ErrFileExists = os.ErrExist + var ErrFileNotFound = os.ErrNotExist + var ErrNoReadlink = errors.New("readlink not supported") + var ErrNoSymlink = errors.New("symlink not supported") + var ErrOutOfRange = errors.New("Out of range") + var ErrTooLarge = errors.New("Too large") + 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 FullBaseFsPath(basePathFs *BasePathFs, relativePath string) string + 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 NeuterAccents(s string) string + func ReadAll(r io.Reader) ([]byte, error) + 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 UnicodeSanitize(s string) string + 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) + type Afero struct + func (a Afero) DirExists(path string) (bool, error) + func (a Afero) Exists(path string) (bool, error) + func (a Afero) FileContainsAnyBytes(filename string, subslices [][]byte) (bool, error) + func (a Afero) FileContainsBytes(filename string, subslice []byte) (bool, error) + func (a Afero) GetTempDir(subPath string) string + func (a Afero) IsDir(path string) (bool, error) + func (a Afero) IsEmpty(path string) (bool, error) + func (a Afero) ReadDir(dirname string) ([]os.FileInfo, error) + func (a Afero) ReadFile(filename string) ([]byte, error) + func (a Afero) SafeWriteReader(path string, r io.Reader) (err error) + func (a Afero) TempDir(dir, prefix string) (name string, err error) + func (a Afero) TempFile(dir, pattern string) (f File, err error) + func (a Afero) Walk(root string, walkFn filepath.WalkFunc) error + func (a Afero) WriteFile(filename string, data []byte, perm os.FileMode) error + func (a Afero) WriteReader(path string, r io.Reader) (err error) + type BasePathFile struct + func (f *BasePathFile) Name() string + type BasePathFs struct + func (b *BasePathFs) Chmod(name string, mode os.FileMode) (err error) + func (b *BasePathFs) Chown(name string, uid, gid int) (err error) + func (b *BasePathFs) Chtimes(name string, atime, mtime time.Time) (err error) + func (b *BasePathFs) Create(name string) (f File, err error) + func (b *BasePathFs) LstatIfPossible(name string) (os.FileInfo, bool, error) + func (b *BasePathFs) Mkdir(name string, mode os.FileMode) (err error) + func (b *BasePathFs) MkdirAll(name string, mode os.FileMode) (err error) + func (b *BasePathFs) Name() string + func (b *BasePathFs) Open(name string) (f File, err error) + func (b *BasePathFs) OpenFile(name string, flag int, mode os.FileMode) (f File, err error) + func (b *BasePathFs) ReadlinkIfPossible(name string) (string, error) + func (b *BasePathFs) RealPath(name string) (path string, err error) + func (b *BasePathFs) Remove(name string) (err error) + func (b *BasePathFs) RemoveAll(name string) (err error) + func (b *BasePathFs) Rename(oldname, newname string) (err error) + func (b *BasePathFs) Stat(name string) (fi os.FileInfo, err error) + func (b *BasePathFs) SymlinkIfPossible(oldname, newname string) error + type CacheOnReadFs struct + func (u *CacheOnReadFs) Chmod(name string, mode os.FileMode) error + func (u *CacheOnReadFs) Chown(name string, uid, gid int) error + func (u *CacheOnReadFs) Chtimes(name string, atime, mtime time.Time) error + func (u *CacheOnReadFs) Create(name string) (File, error) + func (u *CacheOnReadFs) Mkdir(name string, perm os.FileMode) error + func (u *CacheOnReadFs) MkdirAll(name string, perm os.FileMode) error + func (u *CacheOnReadFs) Name() string + func (u *CacheOnReadFs) Open(name string) (File, error) + func (u *CacheOnReadFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (u *CacheOnReadFs) Remove(name string) error + func (u *CacheOnReadFs) RemoveAll(name string) error + func (u *CacheOnReadFs) Rename(oldname, newname string) error + func (u *CacheOnReadFs) Stat(name string) (os.FileInfo, error) + type CopyOnWriteFs struct + func (u *CopyOnWriteFs) Chmod(name string, mode os.FileMode) error + func (u *CopyOnWriteFs) Chown(name string, uid, gid int) error + func (u *CopyOnWriteFs) Chtimes(name string, atime, mtime time.Time) error + func (u *CopyOnWriteFs) Create(name string) (File, error) + func (u *CopyOnWriteFs) LstatIfPossible(name string) (os.FileInfo, bool, error) + func (u *CopyOnWriteFs) Mkdir(name string, perm os.FileMode) error + func (u *CopyOnWriteFs) MkdirAll(name string, perm os.FileMode) error + func (u *CopyOnWriteFs) Name() string + func (u *CopyOnWriteFs) Open(name string) (File, error) + func (u *CopyOnWriteFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (u *CopyOnWriteFs) ReadlinkIfPossible(name string) (string, error) + func (u *CopyOnWriteFs) Remove(name string) error + func (u *CopyOnWriteFs) RemoveAll(name string) error + func (u *CopyOnWriteFs) Rename(oldname, newname string) error + func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error) + func (u *CopyOnWriteFs) SymlinkIfPossible(oldname, newname string) error + type DirsMerger func(lofi, bofi []os.FileInfo) ([]os.FileInfo, error) + type File interface + Name func() string + Readdir func(count int) ([]os.FileInfo, error) + Readdirnames func(n int) ([]string, error) + Stat func() (os.FileInfo, error) + Sync func() error + Truncate func(size int64) error + WriteString func(s string) (ret int, err error) + func TempFile(fs Fs, dir, pattern string) (f File, err error) + type FromIOFS struct + func (f FromIOFS) Chmod(name string, mode os.FileMode) error + func (f FromIOFS) Chown(name string, uid, gid int) error + func (f FromIOFS) Chtimes(name string, atime time.Time, mtime time.Time) error + func (f FromIOFS) Create(name string) (File, error) + func (f FromIOFS) Mkdir(name string, perm os.FileMode) error + func (f FromIOFS) MkdirAll(path string, perm os.FileMode) error + func (f FromIOFS) Name() string + func (f FromIOFS) Open(name string) (File, error) + func (f FromIOFS) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (f FromIOFS) Remove(name string) error + func (f FromIOFS) RemoveAll(path string) error + func (f FromIOFS) Rename(oldname, newname string) error + func (f FromIOFS) Stat(name string) (os.FileInfo, error) + type Fs interface + Chmod func(name string, mode os.FileMode) error + Chown func(name string, uid, gid int) error + Chtimes func(name string, atime time.Time, mtime time.Time) error + Create func(name string) (File, error) + Mkdir func(name string, perm os.FileMode) error + MkdirAll func(path string, perm os.FileMode) error + Name func() string + Open func(name string) (File, error) + OpenFile func(name string, flag int, perm os.FileMode) (File, error) + Remove func(name string) error + RemoveAll func(path string) error + Rename func(oldname, newname string) error + Stat func(name string) (os.FileInfo, error) + 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 + type HttpFs struct + func NewHttpFs(source Fs) *HttpFs + func (h HttpFs) Chmod(name string, mode os.FileMode) error + func (h HttpFs) Chown(name string, uid, gid int) error + func (h HttpFs) Chtimes(name string, atime time.Time, mtime time.Time) error + func (h HttpFs) Create(name string) (File, error) + func (h HttpFs) Dir(s string) *httpDir + func (h HttpFs) Mkdir(name string, perm os.FileMode) error + func (h HttpFs) MkdirAll(path string, perm os.FileMode) error + func (h HttpFs) Name() string + func (h HttpFs) Open(name string) (http.File, error) + func (h HttpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (h HttpFs) Remove(name string) error + func (h HttpFs) RemoveAll(path string) error + func (h HttpFs) Rename(oldname, newname string) error + func (h HttpFs) Stat(name string) (os.FileInfo, error) + type IOFS struct + func NewIOFS(fs Fs) IOFS + func (iofs IOFS) Glob(pattern string) ([]string, error) + func (iofs IOFS) Open(name string) (fs.File, error) + func (iofs IOFS) ReadDir(name string) ([]fs.DirEntry, error) + func (iofs IOFS) ReadFile(name string) ([]byte, error) + func (iofs IOFS) Sub(dir string) (fs.FS, error) + type LinkReader interface + ReadlinkIfPossible func(name string) (string, error) + type Linker interface + SymlinkIfPossible func(oldname, newname string) error + type Lstater interface + LstatIfPossible func(name string) (os.FileInfo, bool, error) + type MemMapFs struct + func (*MemMapFs) Name() string + func (m *MemMapFs) Chmod(name string, mode os.FileMode) error + func (m *MemMapFs) Chown(name string, uid, gid int) error + func (m *MemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error + func (m *MemMapFs) Create(name string) (File, error) + func (m *MemMapFs) List() + func (m *MemMapFs) LstatIfPossible(name string) (os.FileInfo, bool, error) + func (m *MemMapFs) Mkdir(name string, perm os.FileMode) error + func (m *MemMapFs) MkdirAll(path string, perm os.FileMode) error + func (m *MemMapFs) Open(name string) (File, error) + func (m *MemMapFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (m *MemMapFs) Remove(name string) error + func (m *MemMapFs) RemoveAll(path string) error + func (m *MemMapFs) Rename(oldname, newname string) error + func (m *MemMapFs) Stat(name string) (os.FileInfo, error) + type OsFs struct + func (OsFs) Chmod(name string, mode os.FileMode) error + func (OsFs) Chown(name string, uid, gid int) error + func (OsFs) Chtimes(name string, atime time.Time, mtime time.Time) error + func (OsFs) Create(name string) (File, error) + func (OsFs) LstatIfPossible(name string) (os.FileInfo, bool, error) + func (OsFs) Mkdir(name string, perm os.FileMode) error + func (OsFs) MkdirAll(path string, perm os.FileMode) error + func (OsFs) Name() string + func (OsFs) Open(name string) (File, error) + func (OsFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (OsFs) ReadlinkIfPossible(name string) (string, error) + func (OsFs) Remove(name string) error + func (OsFs) RemoveAll(path string) error + func (OsFs) Rename(oldname, newname string) error + func (OsFs) Stat(name string) (os.FileInfo, error) + func (OsFs) SymlinkIfPossible(oldname, newname string) error + type ReadOnlyFs struct + func (r *ReadOnlyFs) Chmod(n string, m os.FileMode) error + func (r *ReadOnlyFs) Chown(n string, uid, gid int) error + func (r *ReadOnlyFs) Chtimes(n string, a, m time.Time) error + func (r *ReadOnlyFs) Create(n string) (File, error) + func (r *ReadOnlyFs) LstatIfPossible(name string) (os.FileInfo, bool, error) + func (r *ReadOnlyFs) Mkdir(n string, p os.FileMode) error + func (r *ReadOnlyFs) MkdirAll(n string, p os.FileMode) error + func (r *ReadOnlyFs) Name() string + func (r *ReadOnlyFs) Open(n string) (File, error) + func (r *ReadOnlyFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (r *ReadOnlyFs) ReadDir(name string) ([]os.FileInfo, error) + func (r *ReadOnlyFs) ReadlinkIfPossible(name string) (string, error) + func (r *ReadOnlyFs) Remove(n string) error + func (r *ReadOnlyFs) RemoveAll(p string) error + func (r *ReadOnlyFs) Rename(o, n string) error + func (r *ReadOnlyFs) Stat(name string) (os.FileInfo, error) + func (r *ReadOnlyFs) SymlinkIfPossible(oldname, newname string) error + type RegexpFile struct + func (f *RegexpFile) Close() error + func (f *RegexpFile) Name() string + func (f *RegexpFile) Read(s []byte) (int, error) + func (f *RegexpFile) ReadAt(s []byte, o int64) (int, error) + func (f *RegexpFile) Readdir(c int) (fi []os.FileInfo, err error) + func (f *RegexpFile) Readdirnames(c int) (n []string, err error) + func (f *RegexpFile) Seek(o int64, w int) (int64, error) + func (f *RegexpFile) Stat() (os.FileInfo, error) + func (f *RegexpFile) Sync() error + func (f *RegexpFile) Truncate(s int64) error + func (f *RegexpFile) Write(s []byte) (int, error) + func (f *RegexpFile) WriteAt(s []byte, o int64) (int, error) + func (f *RegexpFile) WriteString(s string) (int, error) + type RegexpFs struct + func (r *RegexpFs) Chmod(name string, mode os.FileMode) error + func (r *RegexpFs) Chown(name string, uid, gid int) error + func (r *RegexpFs) Chtimes(name string, a, m time.Time) error + func (r *RegexpFs) Create(name string) (File, error) + func (r *RegexpFs) Mkdir(n string, p os.FileMode) error + func (r *RegexpFs) MkdirAll(n string, p os.FileMode) error + func (r *RegexpFs) Name() string + func (r *RegexpFs) Open(name string) (File, error) + func (r *RegexpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (r *RegexpFs) Remove(name string) error + func (r *RegexpFs) RemoveAll(p string) error + func (r *RegexpFs) Rename(oldname, newname string) error + func (r *RegexpFs) Stat(name string) (os.FileInfo, error) + type Symlinker interface + type UnionFile struct + Base File + Layer File + Merger DirsMerger + func (f *UnionFile) Close() error + func (f *UnionFile) Name() string + func (f *UnionFile) Read(s []byte) (int, error) + func (f *UnionFile) ReadAt(s []byte, o int64) (int, error) + func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) + func (f *UnionFile) Readdirnames(c int) ([]string, error) + func (f *UnionFile) Seek(o int64, w int) (pos int64, err error) + func (f *UnionFile) Stat() (os.FileInfo, error) + func (f *UnionFile) Sync() (err error) + func (f *UnionFile) Truncate(s int64) (err error) + func (f *UnionFile) Write(s []byte) (n int, err error) + func (f *UnionFile) WriteAt(s []byte, o int64) (n int, err error) + func (f *UnionFile) WriteString(s string) (n int, err error)