6c9628cdb1
* Rename 'vendor/src' -> 'vendor' * Ignore vendor/ instead of vendor/src/ for lint * Rename 'cmd/client' -> 'cmd/ocic' to make it 'go install'able * Rename 'cmd/server' -> 'cmd/ocid' to make it 'go install'able * Update Makefile to build and install from GOPATH * Update tests to locate ocid/ocic in GOPATH/bin * Search for binaries in GOPATH/bin instead of PATH * Install tools using `go get -u`, so they are updated on each run Signed-off-by: Jonathan Yu <jawnsy@redhat.com>
53 lines
979 B
Go
53 lines
979 B
Go
// +build !windows
|
|
|
|
package system
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
// StatT type contains status of a file. It contains metadata
|
|
// like permission, owner, group, size, etc about a file.
|
|
type StatT struct {
|
|
mode uint32
|
|
uid uint32
|
|
gid uint32
|
|
rdev uint64
|
|
size int64
|
|
mtim syscall.Timespec
|
|
}
|
|
|
|
// Mode returns file's permission mode.
|
|
func (s StatT) Mode() uint32 {
|
|
return s.mode
|
|
}
|
|
|
|
// UID returns file's user id of owner.
|
|
func (s StatT) UID() uint32 {
|
|
return s.uid
|
|
}
|
|
|
|
// GID returns file's group id of owner.
|
|
func (s StatT) GID() uint32 {
|
|
return s.gid
|
|
}
|
|
|
|
// Rdev returns file's device ID (if it's special file).
|
|
func (s StatT) Rdev() uint64 {
|
|
return s.rdev
|
|
}
|
|
|
|
// Size returns file's size.
|
|
func (s StatT) Size() int64 {
|
|
return s.size
|
|
}
|
|
|
|
// Mtim returns file's last modification time.
|
|
func (s StatT) Mtim() syscall.Timespec {
|
|
return s.mtim
|
|
}
|
|
|
|
// GetLastModification returns file's last modification time.
|
|
func (s StatT) GetLastModification() syscall.Timespec {
|
|
return s.Mtim()
|
|
}
|