Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "log"
  6. "os"
  7. )
  8.  
  9. func main() {
  10. // Lstat will return file info, but if it is actually
  11. // a symlink, it will return info about the symlink.
  12. // It will not follow the link and give information
  13. // about the real file
  14. // Symlinks do not work in Windows
  15. fileInfo, err := os.Lstat("original_sym.txt")
  16. if err != nil {
  17. log.Fatal(err)
  18. }
  19. fmt.Printf("Link info: %+v", fileInfo)
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement