lstat_unix.go 358 B

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