From 737ca87f839add969de90f63e9a09f662686dce4 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Sat, 1 Sep 2012 15:09:30 -0500 Subject: [PATCH] BSD - Now receive events for created directories --- fsnotify_bsd.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index c1ec73d..5ddf578 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -290,17 +290,15 @@ func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { // Search for new files for _, fileInfo := range files { - if fileInfo.IsDir() == false { - filePath := filepath.Join(dirPath, fileInfo.Name()) - _, watchFound := w.watches[filePath] - if watchFound == false { - w.fsnFlags[filePath] = FSN_ALL - // Send create event - fileEvent := new(FileEvent) - fileEvent.Name = filePath - fileEvent.create = true - w.internalEvent <- fileEvent - } + filePath := filepath.Join(dirPath, fileInfo.Name()) + _, watchFound := w.watches[filePath] + if watchFound == false { + w.fsnFlags[filePath] = FSN_ALL + // Send create event + fileEvent := new(FileEvent) + fileEvent.Name = filePath + fileEvent.create = true + w.internalEvent <- fileEvent } } w.watchDirectoryFiles(dirPath) -- 2.50.1