Documentation
¶
Overview ¶
Package files has the filesystems a computer can be given. A mount is an afero.Fs, so anything that implements one can be a directory of the computer: memory, a database, an object store. Dir is a directory of the host.
Index ¶
- type File
- type Root
- func (r *Root) Chmod(name string, mode os.FileMode) error
- func (r *Root) Chown(name string, uid, gid int) error
- func (r *Root) Chtimes(name string, atime, mtime time.Time) error
- func (r *Root) Close() error
- func (r *Root) Create(name string) (afero.File, error)
- func (r *Root) Link(from, to string) error
- func (r *Root) LstatIfPossible(name string) (os.FileInfo, bool, error)
- func (r *Root) Mkdir(name string, perm os.FileMode) error
- func (r *Root) MkdirAll(name string, perm os.FileMode) error
- func (r *Root) Name() string
- func (r *Root) Open(name string) (afero.File, error)
- func (r *Root) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (r *Root) ReadlinkIfPossible(name string) (string, error)
- func (r *Root) Remove(name string) error
- func (r *Root) RemoveAll(name string) error
- func (r *Root) Rename(from, to string) error
- func (r *Root) Stat(name string) (os.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
A File is an open file or directory of a Root. Nothing it does names a path again, so it stays the file that was opened whatever happens to the name it was opened by.
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
A Root is a host directory as an afero.Fs that cannot be left. Every operation goes through os.Root, which resolves a name inside the directory and refuses one that leads out of it, by "..", by a symbolic link, or by a link swapped in while the name is being walked. afero's own BasePathFs compares path prefixes, which a symbolic link defeats.
Only regular files and directories can be opened, and no symbolic link can be made.
func Dir ¶
Dir opens the host directory at path. Close it when the computer it was given to is done.
func (*Root) Link ¶
Link makes a hard link. A link to a symbolic link is refused: some systems would link the file it points to.
func (*Root) LstatIfPossible ¶
LstatIfPossible is afero's Lstater.
func (*Root) ReadlinkIfPossible ¶
ReadlinkIfPossible is afero's LinkReader.