stat.go 733 B

1234567891011121314151617181920212223
  1. // Copyright 2017 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package os
  5. import "internal/testlog"
  6. // Stat returns a FileInfo describing the named file.
  7. // If there is an error, it will be of type *PathError.
  8. func Stat(name string) (FileInfo, error) {
  9. testlog.Stat(name)
  10. return statNolog(name)
  11. }
  12. // Lstat returns a FileInfo describing the named file.
  13. // If the file is a symbolic link, the returned FileInfo
  14. // describes the symbolic link. Lstat makes no attempt to follow the link.
  15. // If there is an error, it will be of type *PathError.
  16. func Lstat(name string) (FileInfo, error) {
  17. testlog.Stat(name)
  18. return lstatNolog(name)
  19. }