From: Chris Howey Date: Sat, 14 Jul 2012 18:38:01 +0000 (-0500) Subject: BSD - do not watch moved files (don't know new name) X-Git-Tag: v1.7.2~411 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=1683f487a8d046b4ea11498fcbbe53cfd9d34584;p=fsnotify.git BSD - do not watch moved files (don't know new name) --- diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index 3053b32..c1ec73d 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -246,6 +246,10 @@ func (w *Watcher) readEvents() { // Move to next event events = events[1:] + + if fileEvent.IsRename() { + w.removeWatch(fileEvent.Name) + } } } }