lstat_unix.go 353 B

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