Documentation ¶
Overview ¶
Package stat provides functionality to handle 9p stat values.
Index ¶
- func OsMode(mode Mode) os.FileMode
- type Mode
- type Reader
- type Stat
- func (s *Stat) Decode(r io.Reader) (int64, error)
- func (s *Stat) Encode(w io.Writer) (int64, error)
- func (s *Stat) IsAppend() bool
- func (s *Stat) IsAuth() bool
- func (s *Stat) IsDevice() bool
- func (s *Stat) IsDir() bool
- func (s *Stat) IsExcl() bool
- func (s *Stat) IsMount() bool
- func (s *Stat) IsNamedPipe() bool
- func (s *Stat) IsSetGid() bool
- func (s *Stat) IsSetUid() bool
- func (s *Stat) IsSocket() bool
- func (s *Stat) IsSymlink() bool
- func (s *Stat) IsTmp() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mode ¶
type Mode uint32
Mode represents modes of a directory entry.
const ( // SetGid is setgid (Unix, 9P2000.u) SetGid Mode = 0x00040000 // SetUid is setuid (Unix, 9P2000.u) SetUid Mode = 0x00080000 // Socket is a socket (Unix, 9P2000.u) Socket Mode = 0x00100000 // NamedPipe is a named pipe (Unix, 9P2000.u) NamedPipe Mode = 0x00200000 // Device is a device file (Unix, 9P2000.u) Device Mode = 0x00800000 // Symlink is a symbolic link (Unix, 9P2000.u) Symlink Mode = 0x02000000 // Tmp is a non-backed-up file Tmp Mode = 0x04000000 // Auth is a authentication file Auth Mode = 0x08000000 // Mount is a mounted channel Mount Mode = 0x10000000 // Excl is a exclusive use file Excl Mode = 0x20000000 // Append is a append only file Append Mode = 0x40000000 // Dir is a directory Dir Mode = 0x80000000 )
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a reader for multiple Stats, aka directories.
type Stat ¶
type Stat struct { // Size uint16 Typ uint16 Dev uint32 Qid qid.Qid Mode Mode Atime time.Time Mtime time.Time Length uint64 Name string Uid string Gid string Muid string }
Stat contains file attributes.
Typ and Dev are usually unused. Qid contains the Qid of this file. Mode is a combination of UNIX-permission bits for owner, group and others. Atime contains the time of last access, Mtime the time of last modification. Length is the file length in bytes, directories have a conventional length of 0. Name is the file name and must be "/" if the file is the root directory of the server. Uid is the owners name (not UNIX uid), group is the groups name. Muid is the name of the last user who modified the file.
http://man.cat-v.org/inferno/5/stat
func FileInfo ¶
FileInfo creates Stat using os.FileInfo.Sys(). If using the information returned by Sys() fails, it returns a stat like returned by GenericStat.
func (*Stat) IsNamedPipe ¶
IsNamedPipe returns true if NamedPipe is set.