inotify: Also treat the first WRITE event

This commit is contained in:
nemunaire 2023-10-23 10:03:32 +02:00
parent a2d2457811
commit b3e221a15b
2 changed files with 2 additions and 0 deletions

View File

@ -163,6 +163,7 @@ loop:
} else if err == nil && 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
go treat(ev.Name)
} else if err == nil && *debugINotify {
log.Println("Skipped event:", ev, "for", ev.Name)
}

View File

@ -123,6 +123,7 @@ func main() {
} else if err == nil && 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
l.treat(ev.Name)
} else if *debugINotify {
log.Println("Skipped event:", ev, "for", ev.Name)
}