github.com/mephux/docker@v1.6.0-rc5/pkg/system/stat_linux.go (about)

     1  package system
     2  
     3  import (
     4  	"syscall"
     5  )
     6  
     7  func fromStatT(s *syscall.Stat_t) (*Stat_t, error) {
     8  	return &Stat_t{size: s.Size,
     9  		mode: s.Mode,
    10  		uid:  s.Uid,
    11  		gid:  s.Gid,
    12  		rdev: s.Rdev,
    13  		mtim: s.Mtim}, nil
    14  }
    15  
    16  func Stat(path string) (*Stat_t, error) {
    17  	s := &syscall.Stat_t{}
    18  	err := syscall.Stat(path, s)
    19  	if err != nil {
    20  		return nil, err
    21  	}
    22  	return fromStatT(s)
    23  }