Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"fmt"
"strings"
"github.com/syncthing/notify"
)
var drive = "C"
func main() {
lower := strings.ToLower(drive)
upper := strings.ToUpper(drive)
for _, prefix := range []string{`\\?\`, ""} {
c := make(chan notify.EventInfo)
for _, d := range []string{upper, lower} {
for _, sep := range []string{"", `\`} {
for _, rec := range []string{"...", ""} {
path := prefix + d + ":" + sep + rec
err := notify.Watch(path, c, notify.All)
fmt.Printf("Watching \"%v\": %v\n", path, err)
if err == nil {
notify.Stop(c)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.