github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/pkg/system/lstat_unix.go (about)

     1  // +build !windows
     2  
     3  package system
     4  
     5  import (
     6  	"syscall"
     7  )
     8  
     9  // Lstat takes a path to a file and returns
    10  // a system.StatT type pertaining to that file.
    11  //
    12  // Throws an error if the file does not exist
    13  func Lstat(path string) (*StatT, error) {
    14  	s := &syscall.Stat_t{}
    15  	if err := syscall.Lstat(path, s); err != nil {
    16  		return nil, err
    17  	}
    18  	return fromStatT(s)
    19  }