Documentation
¶
Overview ¶
Package xfs provides an extended file system interface that includes additional methods for writing files and directories, as well as utility functions for reading, writing, and manipulating files and directories within a specified file system.
Index ¶
- func AsOSFile(f fs.File, name string) (*os.File, error)
- func Mkdir(root Root, name string, perm os.FileMode) error
- func MkdirAll(root Root, name string, perm os.FileMode) error
- func MkdirTemp(root Root, dir, pattern string) (string, error)
- func Open(root Root, name string) (fs.File, error)
- func ReadDir(root Root, name string) ([]fs.DirEntry, error)
- func ReadFile(root Root, name string) ([]byte, error)
- func Remove(root Root, name string) error
- func RemoveAll(root Root, name string) (err error)
- func Rename(root Root, oldname, newname string) error
- func SplitPath(path string) []string
- func Stat(root Root, name string) (fs.FileInfo, error)
- func WriteFile(root Root, name string, data []byte, perm os.FileMode) error
- type FS
- type File
- type OSRoot
- func (root *OSRoot) Close() error
- func (root *OSRoot) FSType() string
- func (root *OSRoot) Fd() (int, error)
- func (root *OSRoot) Mkdir(name string, perm os.FileMode) error
- func (root *OSRoot) Open(name string) (fs.File, error)
- func (root *OSRoot) OpenFS() error
- func (root *OSRoot) OpenFile(name string, flags int, perm os.FileMode) (File, error)
- func (root *OSRoot) Remove(name string) error
- func (root *OSRoot) Rename(oldname, newname string) error
- func (root *OSRoot) RepairFS() error
- func (root *OSRoot) Source() string
- type Root
- type UnixRoot
- func (root *UnixRoot) Close() error
- func (root *UnixRoot) FSType() string
- func (root *UnixRoot) Fd() (int, error)
- func (root *UnixRoot) Mkdir(name string, perm os.FileMode) error
- func (root *UnixRoot) Open(name string) (fs.File, error)
- func (root *UnixRoot) OpenFS() error
- func (root *UnixRoot) OpenFile(name string, flags int, perm os.FileMode) (File, error)
- func (root *UnixRoot) Remove(name string) error
- func (root *UnixRoot) Rename(oldname, newname string) error
- func (root *UnixRoot) RepairFS() error
- func (root *UnixRoot) Source() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MkdirTemp ¶
MkdirTemp creates a temporary directory in the specified directory with a given pattern.
func SplitPath ¶
SplitPath splits a path into its components, similar to filepath.Split but returns all parts.
Types ¶
type File ¶
type File interface {
fs.File
io.Closer
io.Reader
io.ReaderAt
io.Seeker
io.Writer
io.WriterAt
Fd() uintptr
}
File is an interface that extends the standard fs.File interface with additional methods for writing.
type OSRoot ¶
type OSRoot struct {
Shadow string
}
OSRoot represents a filesystem wrapper using os interface.
func (*OSRoot) Mkdir ¶
Mkdir creates a new directory in the root filesystem with the specified name and permissions.
func (*OSRoot) Open ¶
Open opens a file in the root filesystem with the specified name in read-only mode.
func (*OSRoot) OpenFile ¶
OpenFile opens a file in the root filesystem with the specified name, flags, and permissions.
type Root ¶
type Root interface {
fs.FS
io.Closer
OpenFS() error
RepairFS() error
Fd() (int, error)
Mkdir(name string, perm os.FileMode) error
OpenFile(name string, flags int, perm os.FileMode) (File, error)
Remove(name string) error
Rename(oldname, newname string) error
Source() string
FSType() string
}
Root is an interface that extends the standard fs.FS interface with Write capabilities.
type UnixRoot ¶
UnixRoot represents a filesystem wrapper for Unix-like systems.
func (*UnixRoot) Fd ¶
Fd returns the file descriptor of the mounted root filesystem. It returns an error if the filesystem is not open or has been closed. Usage of the returned file descriptior is no longer thread safe.
func (*UnixRoot) Mkdir ¶
Mkdir creates a new directory in the root filesystem with the specified name and permissions.
func (*UnixRoot) Open ¶
Open opens a file in the root filesystem with the specified name in read-only mode.
func (*UnixRoot) OpenFile ¶
OpenFile opens a file in the root filesystem with the specified name, flags, and permissions.
func (*UnixRoot) Rename ¶
Rename renames a file or directory in the root filesystem from old to new.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fsopen provides a simple interface to create and manage a filesystem using the Linux syscalls for filesystem operations.
|
Package fsopen provides a simple interface to create and manage a filesystem using the Linux syscalls for filesystem operations. |
|
Package opentree provides a simple interface to create and manage a subfilesystem using the `open_tree` syscall.
|
Package opentree provides a simple interface to create and manage a subfilesystem using the `open_tree` syscall. |