Documentation
¶
Overview ¶
Package rwfs implements a read-write filesystem, extending fs.FS
Index ¶
- Constants
- func Copy(srcFS fs.FS, srcName string, destFS RWFS, destName string) error
- func CopyRecursive(srcFS fs.FS, srcName string, destFS RWFS, destName string) error
- func MkdirAll(rwfs RWFS, name string, perm fs.FileMode) error
- func ReadFile(rfs fs.FS, name string) ([]byte, error)
- func Stat(rfs fs.FS, name string) (fs.FileInfo, error)
- func WriteFile(wfs WriteFS, name string, data []byte, perm fs.FileMode) error
- type DirEntry
- type FileInfo
- type MemChild
- type MemDir
- type MemDirFP
- type MemFS
- func (o *MemFS) Create(name string) (WFile, error)
- func (o *MemFS) Mkdir(name string, perm fs.FileMode) error
- func (o *MemFS) Open(name string) (fs.File, error)
- func (o *MemFS) OpenFile(name string, flags int, perm fs.FileMode) (RWFile, error)
- func (o *MemFS) Remove(name string) error
- func (o *MemFS) Sub(name string) (*MemFS, error)
- type MemFile
- type MemFileFP
- type OSFS
- func (o *OSFS) Create(name string) (WFile, error)
- func (o *OSFS) Mkdir(name string, perm fs.FileMode) error
- func (o *OSFS) Open(name string) (fs.File, error)
- func (o *OSFS) OpenFile(name string, flag int, perm fs.FileMode) (RWFile, error)
- func (o *OSFS) Remove(name string) error
- func (o *OSFS) Sub(name string) (*OSFS, error)
- type OSFile
- type ROFS
- type ROFile
- type ROOpts
- type RWFS
- type RWFile
- type WFile
- type WriteFS
Constants ¶
View Source
const ( // exactly one of these must be used O_RDONLY = os.O_RDONLY // read-only O_WRONLY = os.O_WRONLY // write-only O_RDWR = os.O_RDWR // read-write // remaining values may be or'ed O_APPEND = os.O_APPEND // append when writing O_CREATE = os.O_CREATE // create if missing O_EXCL = os.O_EXCL // file must not exist, used with O_CREATE O_SYNC = os.O_SYNC // synchronous I/O O_TRUNC = os.O_TRUNC // truncate on open )
Variables ¶
This section is empty.
Functions ¶
func CopyRecursive ¶
CopyRecursive will recursively copy a directory tree to the destination
Types ¶
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
type MemFS ¶
type MemFS struct {
// contains filtered or unexported fields
}
type WriteFS ¶
type WriteFS interface {
// Create creates a new file
Create(string) (WFile, error)
// Mkdir creates a directory
Mkdir(string, fs.FileMode) error
// OpenFile generalized file open with options for a flag and permissions
OpenFile(string, int, fs.FileMode) (RWFile, error)
// Remove removes the named file or (empty) directory.
Remove(string) error
}
Click to show internal directories.
Click to hide internal directories.