Created
October 2, 2015 03:04
-
-
Save illicitonion/b0d0af8a720667c80f00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"os" | |
"path/filepath" | |
fsnotify "gopkg.in/fsnotify.v1" | |
) | |
func main() { | |
if err := os.Mkdir("dir", 0700); err != nil { | |
log.Fatalf("Error making directory: %v", err) | |
} | |
if err := os.Symlink(".", "dir/symlink"); err != nil { | |
log.Fatalf("Error making symlink: %v", err) | |
} | |
w, err := fsnotify.NewWatcher() | |
if err != nil { | |
log.Fatalf("Error making watcher: %v", err) | |
} | |
dir, err := os.Getwd() | |
if err != nil { | |
log.Fatalf("Error getting wd: %v", err) | |
} | |
w.Add(filepath.Join(dir, "dir")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment