Versions in this module Expand all Collapse all v1 v1.3.1 Oct 11, 2021 v1.3.0 Sep 24, 2021 Changes in this version + type CopyEvent struct + type CopyOverEvent struct + type CreateFileEvent struct + type DeleteDirEvent struct + type DeleteFileEvent struct + type Digest []byte + func (d Digest) Equals(other Digest) bool + func (d Digest) Hex() string + type Error string + const ErrBrokenLink + const ErrDirectory + const ErrFileExists + const ErrInvalid + const ErrNonDirectory + const ErrNonLink + const ErrNotWritable + const ErrPathNotFound + func (e Error) Error() string + type Event interface + Path func() *Path + type File interface + type FileEvent interface + Size func() int64 + type Listener func(event Event) + type Path struct + func (p *Path) Append() (File, error) + func (p *Path) AppendMode(mode os.FileMode) (file File, err error) + func (p *Path) Base() string + func (p *Path) BytesAreEqual(other *Path) (isEqual bool, err error) + func (p *Path) BytesAreEqualToBytes(other []byte) (isEqual bool, err error) + func (p *Path) BytesIfExistsAreEqual(other *Path) (isEqual bool, err error) + func (p *Path) BytesIfExistsAreEqualToBytes(other []byte) (isEqual bool, err error) + func (p *Path) Children() (paths Paths, err error) + func (p *Path) ChildrenIfIsDir() (Paths, error) + func (p *Path) Chmod(mode os.FileMode) error + func (p *Path) CopyTo(target *Path) error + func (p *Path) Create() (File, error) + func (p *Path) CreateMode(mode os.FileMode) (file File, err error) + func (p *Path) Delete() (err error) + func (p *Path) DeleteIfExists() error + func (p *Path) Digest(hash hash.Hash) (d Digest, err error) + func (p *Path) DigestIfExists(hash hash.Hash) (d Digest, err error) + func (p *Path) Exists() bool + func (p *Path) Extension() string + func (p *Path) Glob(pattern string) (paths Paths, err error) + func (p *Path) IsDir() bool + func (p *Path) IsEmpty() (isEmpty bool, err error) + func (p *Path) IsNonDir() bool + func (p *Path) Join(a ...string) *Path + func (p *Path) KeepChildren(childNames ...string) (err error) + func (p *Path) Make() error + func (p *Path) MakeMode(mode os.FileMode) error + func (p *Path) MustAppend() File + func (p *Path) MustAppendMode(mode os.FileMode) File + func (p *Path) MustBytesAreEqual(other *Path) bool + func (p *Path) MustBytesAreEqualToBytes(other []byte) bool + func (p *Path) MustBytesIfExistsAreEqual(other *Path) bool + func (p *Path) MustBytesIfExistsAreEqualToBytes(other []byte) bool + func (p *Path) MustChildren() Paths + func (p *Path) MustChildrenIfIsDir() Paths + func (p *Path) MustChmod(mode os.FileMode) + func (p *Path) MustCreate() File + func (p *Path) MustCreateMode(mode os.FileMode) File + func (p *Path) MustDelete() + func (p *Path) MustDeleteIfExists() + func (p *Path) MustDigest(hash hash.Hash) Digest + func (p *Path) MustDigestIfExists(hash hash.Hash) Digest + func (p *Path) MustGlob(pattern string) Paths + func (p *Path) MustIsEmpty() bool + func (p *Path) MustKeepChildren(childNames ...string) + func (p *Path) MustMake() *Path + func (p *Path) MustMakeMode(mode os.FileMode) *Path + func (p *Path) MustOpen() File + func (p *Path) MustReadBytes() []byte + func (p *Path) MustReadBytesIfExists() []byte + func (p *Path) MustReadLink() *Path + func (p *Path) MustReadString() string + func (p *Path) MustReadStringIfExists() string + func (p *Path) MustReadTo(writer io.Writer) + func (p *Path) MustReadToIfExists(writer io.Writer) + func (p *Path) MustRemoveEmptyDirs() (removed Paths) + func (p *Path) MustRemoveEmptyDirsAndSelf() (removed Paths) + func (p *Path) MustRemoveEmptyDirsRecursive() (removed Paths) + func (p *Path) MustRemoveEmptyDirsRecursiveAndSelf() (removed Paths) + func (p *Path) MustRename(target *Path) + func (p *Path) MustSha1Digest() Digest + func (p *Path) MustSha1DigestIfExists() Digest + func (p *Path) MustSha224Digest() Digest + func (p *Path) MustSha224DigestIfExists() Digest + func (p *Path) MustSha256Digest() Digest + func (p *Path) MustSha256DigestIfExists() Digest + func (p *Path) MustSha384Digest() Digest + func (p *Path) MustSha384DigestIfExists() Digest + func (p *Path) MustSha512Digest() Digest + func (p *Path) MustSha512DigestIfExists() Digest + func (p *Path) MustSize() int64 + func (p *Path) MustSizeIfExists() int64 + func (p *Path) MustStat() os.FileInfo + func (p *Path) MustSymlinkTo(target *Path) + func (p *Path) MustTouch() *Path + func (p *Path) MustWd() *Path + func (p *Path) MustWriteBytes(b []byte) + func (p *Path) MustWriteBytesUnlessEqual(b []byte) + func (p *Path) MustWriteFrom(reader io.Reader) + func (p *Path) MustWriteString(s string) + func (p *Path) MustWriteStringUnlessEqual(s string) + func (p *Path) Open() (File, error) + func (p *Path) Parent() *Path + func (p *Path) ReadBytes() (b []byte, err error) + func (p *Path) ReadBytesIfExists() (b []byte, err error) + func (p *Path) ReadLink() (*Path, error) + func (p *Path) ReadString() (string, error) + func (p *Path) ReadStringIfExists() (str string, err error) + func (p *Path) ReadTo(writer io.Writer) (err error) + func (p *Path) ReadToIfExists(writer io.Writer) error + func (p *Path) RemoveEmptyDirs() (removed Paths, err error) + func (p *Path) RemoveEmptyDirsAndSelf() (removed Paths, err error) + func (p *Path) RemoveEmptyDirsRecursive() (removed Paths, err error) + func (p *Path) RemoveEmptyDirsRecursiveAndSelf() (removed Paths, err error) + func (p *Path) Rename(target *Path) (err error) + func (p *Path) Sha1Digest() (Digest, error) + func (p *Path) Sha1DigestIfExists() (Digest, error) + func (p *Path) Sha224Digest() (Digest, error) + func (p *Path) Sha224DigestIfExists() (Digest, error) + func (p *Path) Sha256Digest() (Digest, error) + func (p *Path) Sha256DigestIfExists() (Digest, error) + func (p *Path) Sha384Digest() (Digest, error) + func (p *Path) Sha384DigestIfExists() (Digest, error) + func (p *Path) Sha512Digest() (Digest, error) + func (p *Path) Sha512DigestIfExists() (Digest, error) + func (p *Path) Size() (int64, error) + func (p *Path) SizeIfExists() (int64, error) + func (p *Path) Stat() (os.FileInfo, error) + func (p *Path) String() string + func (p *Path) SymlinkTo(target *Path) error + func (p *Path) Touch() error + func (p *Path) UserHome() (*Path, error) + func (p *Path) Wd() (*Path, error) + func (p *Path) WriteBytes(b []byte) error + func (p *Path) WriteBytesUnlessEqual(b []byte) error + func (p *Path) WriteCloser() io.WriteCloser + func (p *Path) WriteFrom(reader io.Reader) (err error) + func (p *Path) WriteString(s string) error + func (p *Path) WriteStringUnlessEqual(s string) error + type Paths []*Path + func (p Paths) All(predicate func(path *Path) bool) bool + func (p Paths) Any(predicate func(path *Path) bool) bool + func (p Paths) Dirs() (dirs Paths) + func (p Paths) NonDirs() (nonDirs Paths) + type RenameEvent struct + type RewriteFileEvent struct + type SymlinkEvent struct + type System interface + Chmod func(name string, mode os.FileMode) error + Chtimes func(name string, atime time.Time, mtime time.Time) error + CurrentUser func() (*user.User, error) + Getwd func() (dir string, err error) + Glob func(pattern string) (matches []string, err error) + Join func(elem ...string) string + Lstat func(name string) (os.FileInfo, error) + MkdirAll func(path string, perm os.FileMode) error + OpenFile func(name string, flag int, perm os.FileMode) (File, error) + ReadDir func(name string) ([]os.DirEntry, error) + ReadFile func(name string) ([]byte, error) + Readlink func(name string) (string, error) + Remove func(name string) error + RemoveAll func(path string) error + Rename func(oldpath, newpath string) error + Root func() string + SupportsSymlinks func() bool + Symlink func(oldname, newname string) error + var LocalSystem System = local{} + type TargetEvent interface + Target func() *Path + type Tree struct + func NewTree() (t *Tree) + func NewTreeWithSystem(system System) (t *Tree) + func (t *Tree) Subscribe(listener Listener) (unsubscribe func()) + type VirtualSystem struct + func NewVirtualSystem() *VirtualSystem + func (v *VirtualSystem) Chmod(name string, mode os.FileMode) error + func (v *VirtualSystem) Chtimes(name string, atime time.Time, mtime time.Time) error + func (v *VirtualSystem) CurrentUser() (*user.User, error) + func (v *VirtualSystem) Getwd() (dir string, err error) + func (v *VirtualSystem) Glob(pattern string) (matches []string, err error) + func (v *VirtualSystem) Join(elem ...string) string + func (v *VirtualSystem) Lstat(name string) (os.FileInfo, error) + func (v *VirtualSystem) MkdirAll(path string, perm os.FileMode) error + func (v *VirtualSystem) OpenFile(name string, flag int, perm os.FileMode) (File, error) + func (v *VirtualSystem) ReadDir(name string) (entries []os.DirEntry, err error) + func (v *VirtualSystem) ReadFile(name string) (b []byte, err error) + func (v *VirtualSystem) Readlink(name string) (string, error) + func (v *VirtualSystem) Remove(name string) error + func (v *VirtualSystem) RemoveAll(path string) error + func (v *VirtualSystem) Rename(oldpath, newpath string) error + func (v *VirtualSystem) Root() string + func (v *VirtualSystem) SupportsSymlinks() bool + func (v *VirtualSystem) Symlink(oldname, newname string) error