lstat_unix.go 458 B

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