Documentation ¶
Overview ¶
Package os implements all of the familiar behavior from the standard library using hackpadfs's interfaces.
Index ¶
- type FS
- func (fs *FS) Chmod(name string, mode hackpadfs.FileMode) error
- func (fs *FS) Chown(name string, uid, gid int) error
- func (fs *FS) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (fs *FS) Create(name string) (hackpadfs.File, error)
- func (fs *FS) FromOSPath(osPath string) (string, error)
- func (fs *FS) Lstat(name string) (hackpadfs.FileInfo, error)
- func (fs *FS) Mkdir(name string, perm hackpadfs.FileMode) error
- func (fs *FS) MkdirAll(path string, perm hackpadfs.FileMode) error
- func (fs *FS) Open(name string) (hackpadfs.File, error)
- func (fs *FS) OpenFile(name string, flag int, perm hackpadfs.FileMode) (hackpadfs.File, error)
- func (fs *FS) ReadDir(name string) ([]hackpadfs.DirEntry, error)
- func (fs *FS) ReadFile(name string) ([]byte, error)
- func (fs *FS) Remove(name string) error
- func (fs *FS) RemoveAll(name string) error
- func (fs *FS) Rename(oldname, newname string) error
- func (fs *FS) Stat(name string) (hackpadfs.FileInfo, error)
- func (fs *FS) Sub(dir string) (hackpadfs.FS, error)
- func (fs *FS) SubVolume(volumeName string) (hackpadfs.FS, error)
- func (fs *FS) Symlink(oldname, newname string) error
- func (fs *FS) ToOSPath(fsPath string) (string, error)
- func (fs *FS) WriteFile(name string, data []byte, perm hackpadfs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS wraps the 'os' package as an FS implementation.
func NewFS ¶
func NewFS() *FS
NewFS returns a new FS. All file paths are relative to the root path. Root is '/' on Unix and 'C:\' on Windows. Use fs.Sub() to select a different root path. SubVolume on Windows can set the volume name.
func (*FS) FromOSPath ¶ added in v0.1.5
FromOSPath converts an absolute 'os' package path to the valid equivalent 'io/fs' package path for this FS.
Returns an error for any of the following conditions:
- The path is not absolute.
- The path does not match fs's volume name set by SubVolume().
- The path does not share fs's root path set by Sub().
func (*FS) SubVolume ¶ added in v0.1.3
SubVolume is like Sub, but only sets the volume name (i.e. for Windows). Calling SubVolume again on the returned FS results in an error.