2014-11-13 20:36:05 +00:00
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
2015-03-31 08:03:31 +00:00
|
|
|
// Stat_t type contains status of a file. It contains metadata
|
|
|
|
// like permission, owner, group, size, etc about a file
|
2015-03-11 15:42:49 +00:00
|
|
|
type Stat_t struct {
|
2014-11-13 20:36:05 +00:00
|
|
|
mode uint32
|
|
|
|
uid uint32
|
|
|
|
gid uint32
|
|
|
|
rdev uint64
|
|
|
|
size int64
|
|
|
|
mtim syscall.Timespec
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) Mode() uint32 {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.mode
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) Uid() uint32 {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.uid
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) Gid() uint32 {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.gid
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) Rdev() uint64 {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.rdev
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) Size() int64 {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.size
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) Mtim() syscall.Timespec {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.mtim
|
|
|
|
}
|
|
|
|
|
2015-03-11 15:42:49 +00:00
|
|
|
func (s Stat_t) GetLastModification() syscall.Timespec {
|
2014-11-13 20:36:05 +00:00
|
|
|
return s.Mtim()
|
|
|
|
}
|