diff --git a/backend/main.go b/backend/main.go index db1f6b18..10e97e0f 100644 --- a/backend/main.go +++ b/backend/main.go @@ -109,6 +109,8 @@ func main() { log.Fatal(err) } + watchedNotify := fsnotify.Create + for { select { case ev := <-watcher.Events: @@ -117,8 +119,11 @@ func main() { if err := watchsubdir(watcher, ev.Name); err != nil { log.Println(err) } - } else if ev.Op & fsnotify.Create == fsnotify.Create { + } else if ev.Op & watchedNotify == watchedNotify { go treat(ev.Name) + } else if ev.Op & fsnotify.Write == fsnotify.Write { + log.Println("FSNOTIFY WRITE SEEN. Prefer looking at them, as it appears files are not atomically moved.") + watchedNotify = fsnotify.Write } else if *debugINotify { log.Println("Skipped event:", ev, "for", ev.Name) }