Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fid ¶
type Fid struct {
// contains filtered or unexported fields
}
Fid represents a file on the file system.
func Attach ¶
Attach introduces a new user to the file system, and establishes a fid as the root for that user on the file tree selected by export. If uid is not set to proto.NoUid (~0), is the uid of the user and is used in preference to username.
func (*Fid) Create ¶
Create creates a regular file name in directory represented by fid and prepares it for I/O. After the call fid represents the new file.
Flag contains Linux open(2) flags bits, e.g. O_RDONLY, O_WRONLY, and perm contains Linux creat(2) mode bits. Gid is the effective gid of the caller.
func (*Fid) Open ¶
Open prepares fid for file I/O. Flag contains Linux open(2) flags bits, e.g. O_RDONLY, O_WRONLY, O_RDWR.
type File ¶
type File interface { WriteAt(p []byte, offset int64) (int, error) ReadAt(p []byte, offset int64) (int, error) Close() error }
File represents a file in the filesystem and is a set of operations corresponding to a single node.
type FileSystem ¶
type FileSystem interface { Mknod(path string, perm os.FileMode, major, minor uint32, uid, gid int) error Create(path string, flags int, perm os.FileMode, uid, gid int) (File, error) Open(path string, flags int, uid, gid int) (File, error) Remove(path string, uid, gid int) error Stat(path string) (*Stat, error) Lookup(username string, uid int) (gid int, err error) Close() error }
FileSystem is the filesystem interface. Any simulated or real system should implement this interface.