From 84058fc68ef2f9f110e2eefb3f6320fbe4d76cc4 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Tue, 18 Oct 2011 05:38:05 -0700 Subject: [PATCH] BSD: Auto add watch on file creation to match linux --- fsnotify_bsd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index 3375c9b..d9d7754 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -248,6 +248,9 @@ func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { if fileInfo.IsRegular() == true { filePath := path.Join(dirPath, fileInfo.Name) if w.watches[filePath] == 0 { + // Watch file to mimic linux fsnotify + w.addWatch(filePath, NOTE_DELETE|NOTE_WRITE|NOTE_RENAME) + // Send create event fileEvent := new(FileEvent) fileEvent.Name = filePath -- 2.50.1