You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
package main
import (
// "bytes"
"fmt"
"github.com/howeyc/fsnotify"
"log"
//"os/exec"
//"strings"
)
func main() {
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Fatal(err)
}
done := make(chan bool)
// Process events
go func() {
for {
select {
// it is called twice when one file is modified in windows !!
case ev := <-watcher.Event:
fmt.Println(ev)
case err := <-watcher.Error:
log.Println("error:", err)
}
}
}()
err = watcher.Watch("c:\\test")
if err != nil {
log.Fatal("not exists")
}
<-done
watcher.Close()
}
The text was updated successfully, but these errors were encountered:
Can you touch a file in Windows (perhaps in PowerShell?).
FYI, development of fsnotify has moved to: https://github.com/go-fsnotify/fsnotify. Though little has changed with the Windows support, so this is sure to still be an issue. 😦
The text was updated successfully, but these errors were encountered: