github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/pkg/system/lstat_unix.go (about) 1 // +build !windows 2 3 package system // import "github.com/docker/docker/pkg/system" 4 5 import ( 6 "os" 7 "syscall" 8 ) 9 10 // Lstat takes a path to a file and returns 11 // a system.StatT type pertaining to that file. 12 // 13 // Throws an error if the file does not exist 14 func Lstat(path string) (*StatT, error) { 15 s := &syscall.Stat_t{} 16 if err := syscall.Lstat(path, s); err != nil { 17 return nil, &os.PathError{Op: "Lstat", Path: path, Err: err} 18 } 19 return fromStatT(s) 20 }