github.com/jingleWang/moby@v1.13.1/pkg/system/stat.go (about)

     1  // +build !windows
     2  
     3  package system
     4  
     5  import (
     6  	"syscall"
     7  )
     8  
     9  // StatT type contains status of a file. It contains metadata
    10  // like permission, owner, group, size, etc about a file.
    11  type StatT struct {
    12  	mode uint32
    13  	uid  uint32
    14  	gid  uint32
    15  	rdev uint64
    16  	size int64
    17  	mtim syscall.Timespec
    18  }
    19  
    20  // Mode returns file's permission mode.
    21  func (s StatT) Mode() uint32 {
    22  	return s.mode
    23  }
    24  
    25  // UID returns file's user id of owner.
    26  func (s StatT) UID() uint32 {
    27  	return s.uid
    28  }
    29  
    30  // GID returns file's group id of owner.
    31  func (s StatT) GID() uint32 {
    32  	return s.gid
    33  }
    34  
    35  // Rdev returns file's device ID (if it's special file).
    36  func (s StatT) Rdev() uint64 {
    37  	return s.rdev
    38  }
    39  
    40  // Size returns file's size.
    41  func (s StatT) Size() int64 {
    42  	return s.size
    43  }
    44  
    45  // Mtim returns file's last modification time.
    46  func (s StatT) Mtim() syscall.Timespec {
    47  	return s.mtim
    48  }
    49  
    50  // GetLastModification returns file's last modification time.
    51  func (s StatT) GetLastModification() syscall.Timespec {
    52  	return s.Mtim()
    53  }