]> go.fuhry.dev Git - fsnotify.git/commitdiff
BSD - do not watch moved files (don't know new name)
authorChris Howey <chris@howey.me>
Sat, 14 Jul 2012 18:38:01 +0000 (13:38 -0500)
committerChris Howey <chris@howey.me>
Sat, 14 Jul 2012 18:38:01 +0000 (13:38 -0500)
fsnotify_bsd.go

index 3053b32a206a433c17a8855654d2de3018b4ecd3..c1ec73d783aa76419e5f537d355d8c4956ddfa98 100644 (file)
@@ -246,6 +246,10 @@ func (w *Watcher) readEvents() {
 
                        // Move to next event
                        events = events[1:]
+
+                       if fileEvent.IsRename() {
+                               w.removeWatch(fileEvent.Name)
+                       }
                }
        }
 }