Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OS = NewOsImpl()
Functions ¶
This section is empty.
Types ¶
type Os ¶
type Os interface {
// Lstat returns a FileInfo describing the named file.
// If the file is a symbolic link, the returned FileInfo
// describes the symbolic link. Lstat makes no attempt to follow the link.
// If there is an error, it will be of type *PathError.
Lstat(name string) (fs.FileInfo, error)
// Stat returns a FileInfo describing the named file.
// If there is an error, it will be of type *PathError.
Stat(name string) (fs.FileInfo, error)
// Remove removes the named file or (empty) directory.
// If there is an error, it will be of type *PathError.
Remove(name string) error
// ReadFile reads the named file 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.
ReadFile(name string) ([]byte, error)
// WriteFile mirrors ioutil.WriteFile, replacing an existing file with the same
// name atomically.
WriteFile(name string, data []byte, perm fs.FileMode, opts ...renameio.Option) error
}
Os is an interface that wraps os package APIs
Click to show internal directories.
Click to hide internal directories.