Documentation
¶
Overview ¶
Package diskfs provides a glue layer between OS's file system and 9P file system. It can be used to export OS's file tree via 9P protocol.
Index ¶
- type FS
- type File
- func (f *File) Close() error
- func (f *File) Create(name string, uid string, mode lib9p.OpenMode, perm lib9p.FileMode) (file lib9p.File, err error)
- func (f *File) Read(b []byte) (int, error)
- func (f *File) ReadAt(p []byte, off int64) (int, error)
- func (f *File) ReadDir(n int) ([]fs.DirEntry, error)
- func (f *File) Remove() error
- func (f *File) Stat() (fs.FileInfo, error)
- func (f *File) WStat(s *lib9p.Stat) error
- func (f *File) WriteAt(p []byte, off int64) (int, error)
- type QidPool
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 is a file system to export OS's file system via 9P protocol.
func (*FS) OpenFile ¶
OpenFile opens the named file with specified omode by calling os.OpenFile. This signature is derived from os.OpenFile(), but creating the specified file is not implemented yet and therefore, perm is not used.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents a file.
func (*File) Create ¶
func (f *File) Create(name string, uid string, mode lib9p.OpenMode, perm lib9p.FileMode) (file lib9p.File, err error)
Create creates file named name in the directory f, and returns the newly created file.
func (*File) Read ¶
Read reads up to len(b) bytes from the File and stores them in b. It returns the number of bytes read and any error encountered. At end of file. Read returns 0, io.EOF.
func (*File) ReadDir ¶
ReadDir reads the contents of the directory and returns a slice of up to n *lib9p.DirEntry values in directory order. Subsequent calls on the same file will yield further DirEntry values.
If n > 0, ReadDir returns at most n DirEntry structures. In this case, if ReadDir returns an empty slice, it will return a non-nil error explaining why. At the end of a directory, the error is io.EOF. (ReadDir must return io.EOF itself, not an error wrapping io.EOF.)
If n <= 0, ReadDir returns all the DirEntry values from the directory in a single slice. In this case, if ReadDir succeeds (reads all the way to the end of the directory), it returns the slice and a nil error. If it encounters an error before the end of the directory, ReadDir returns the DirEntry list read until that point and a non-nil error.
func (*File) Stat ¶
Stat returns the *lib9p.FileInfo structure describing file.
type QidPool ¶
type QidPool struct {
// contains filtered or unexported fields
}
QidPool is the list of Qids in the file system.