Documentation
¶
Index ¶
- Constants
- func IsBlk(m Mode) bool
- func IsBlkFile(file *os.File) (bool, error)
- func IsBlkPath(path string) (bool, error)
- func IsChr(m Mode) bool
- func IsChrFile(file *os.File) (bool, error)
- func IsChrPath(path string) (bool, error)
- func IsDir(m Mode) bool
- func IsDirFile(file *os.File) (bool, error)
- func IsDirPath(path string) (bool, error)
- func IsFifo(m Mode) bool
- func IsFifoFile(file *os.File) (bool, error)
- func IsFifoPath(path string) (bool, error)
- func IsLnk(m Mode) bool
- func IsLnkFile(file *os.File) (bool, error)
- func IsLnkPath(path string) (bool, error)
- func IsReg(m Mode) bool
- func IsRegFile(file *os.File) (bool, error)
- func IsRegPath(path string) (bool, error)
- func IsSet(mode, m Mode) bool
- func IsSetFile(file *os.File, m Mode) (bool, error)
- func IsSetPath(path string, m Mode) (bool, error)
- func IsSock(m Mode) bool
- func IsSockFile(file *os.File) (bool, error)
- func IsSockPath(path string) (bool, error)
- func SetFile(file *os.File, m Mode) error
- func SetPath(path string, m Mode) error
- func UnsetFile(file *os.File, m Mode) error
- func UnsetPath(path string, m Mode) error
- type Mode
Constants ¶
View Source
const ( ReadUser = S_IRUSR // Read user WriteUser = S_IWUSR // Write user ExecUser = S_IXUSR // Execute user ReadGroup = S_IRGRP // Read group WriteGroup = S_IWGRP // Write group ExecGroup = S_IXGRP // Execute group ReadOther = S_IROTH // Read other WriteOther = S_IWOTH // Write other ExecOther = S_IXOTH // Execute other )
Easy to use aliases
Variables ¶
This section is empty.
Functions ¶
func IsBlkPath ¶
IsBlkPath returns whether the file in path is a block special file (a device like a disk).
func IsChrFile ¶
IsChrFile returns whether the file is a character special file (a device like a terminal).
func IsChrPath ¶
IsChrPath returns whether the file in path is a character special file (a device like a terminal).
func IsFifoFile ¶
IsFifoFile returns whether the file is a FIFO special file, or a pipe.
func IsFifoPath ¶
IsFifoPath returns whether the file in path is a FIFO special file, or a pipe.
func IsSetPath ¶
GetPath returns the mode of the file in path. This function does not follow symbolic link.
func IsSockFile ¶
IsSockFile returns whether the file is a socket.
func IsSockPath ¶
IsSockPath returns whether the file in path is a socket.
Types ¶
type Mode ¶
type Mode uint32
const ( S_IRUSR Mode = 0x00400 // Read permission bit for the owner of the file. S_IWUSR Mode = 0x00200 // Write permission bit for the owner of the file. S_IXUSR Mode = 0x00100 // Execute (for ordinary files) or search (for directories) permission bit for the owner of the file. S_IRWXU Mode = 0x00700 // This is equivalent to (S_IRUSR | S_IWUSR | S_IXUSR). S_IRGRP Mode = 0x00040 // Read permission bit for the group owner of the file. S_IWGRP Mode = 0x00020 // Write permission bit for the group owner of the file. S_IXGRP Mode = 0x00010 // Execute or search permission bit for the group owner of the file. S_IRWXG Mode = 0x00070 // This is equivalent to (S_IRGRP | S_IWGRP | S_IXGRP). S_IROTH Mode = 0x00004 // Read permission bit for other users. S_IWOTH Mode = 0x00002 // Write permission bit for other users. S_IXOTH Mode = 0x00001 // Execute or search permission bit for other users. S_IRWXO Mode = 0x00007 // This is equivalent to (S_IROTH | S_IWOTH | S_IXOTH). S_IFMT Mode = 00170000 // This is a bit mask used to extract the file type code from a mode value. S_IFSOCK Mode = 0140000 // This is the file type constant of a socket. S_IFLNK Mode = 0120000 // This is the file type constant of a symbolic link. S_IFREG Mode = 0100000 // This is the file type constant of a regular file. S_IFBLK Mode = 0060000 // This is the file type constant of a block-oriented device file. S_IFDIR Mode = 0040000 // This is the file type constant of a directory file. S_IFCHR Mode = 0020000 // This is the file type constant of a character-oriented device file. S_IFIFO Mode = 0010000 // This is the file type constant of a FIFO or pipe. S_ISUID Mode = 0004000 // This is the set-user-ID on execute bit. S_ISGID Mode = 0002000 // This is the set-group-ID on execute bit. S_ISVTX Mode = 0001000 // This is the sticky bit. )
Click to show internal directories.
Click to hide internal directories.