Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "log"
- "os"
- )
- func main() {
- // Lstat will return file info, but if it is actually
- // a symlink, it will return info about the symlink.
- // It will not follow the link and give information
- // about the real file
- // Symlinks do not work in Windows
- fileInfo, err := os.Lstat("original_sym.txt")
- if err != nil {
- log.Fatal(err)
- }
- fmt.Printf("Link info: %+v", fileInfo)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement