Documentation
¶
Index ¶
- Constants
- type PermUser
- func (p *PermUser) UserExecutable() bool
- func (p *PermUser) UserReadExecutable() bool
- func (p *PermUser) UserReadable() bool
- func (p *PermUser) UserWritable() bool
- func (p *PermUser) UserWriteExecutable() bool
- func (p *PermUser) UserWriteReadExecutable() bool
- func (p *PermUser) UserWriteReadable() bool
Constants ¶
const ( OsRead = 0o4 OsWrite = 0o2 OsEx = 0o1 OsUserShift = 6 OsGroupShift = 3 OsOthShift = 0 OsUserR = OsRead << OsUserShift OsUserW = OsWrite << OsUserShift OsUserX = OsEx << OsUserShift OsGroupR = OsRead << OsGroupShift OsGroupW = OsWrite << OsGroupShift OsGroupX = OsEx << OsGroupShift OsOthR = OsRead << OsOthShift OsOthW = OsWrite << OsOthShift OsOthX = OsEx << OsOthShift )
List of different OS permission bits
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermUser ¶ added in v0.2.0
type PermUser struct {
Path string
Stat os.FileInfo
UID uint32
GID uint32
CurUserUID int64
CurUserGIDs []int64
}
PermUser implements the main struct of the fileperm packages. All methods are based on it
func New ¶
New returns a new PermUser struct. NewFileUserPerm expects a file path string as input and will return an error if the initial operations failed
func (*PermUser) UserExecutable ¶ added in v0.2.0
UserExecutable returns true if the filepath is executable by the current user
func (*PermUser) UserReadExecutable ¶ added in v0.2.0
UserReadExecutable returns true if the filepath is read- and executable by the current user
func (*PermUser) UserReadable ¶ added in v0.2.0
UserReadable returns true if the filepath is readable by the current user
func (*PermUser) UserWritable ¶ added in v0.2.0
UserWritable returns true if the filepath is writable by the current user
func (*PermUser) UserWriteExecutable ¶ added in v0.2.0
UserWriteExecutable returns true if the filepath is write- and executable by the current user
func (*PermUser) UserWriteReadExecutable ¶ added in v0.2.0
UserWriteReadExecutable returns true if the filepath is write- and read- and executable by the current user
func (*PermUser) UserWriteReadable ¶ added in v0.2.0
UserWriteReadable returns true if the filepath is write- and readable by the current user