From: Chris Howey Date: Sat, 1 Sep 2012 20:09:30 +0000 (-0500) Subject: BSD - Now receive events for created directories X-Git-Tag: v1.7.2~407 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=737ca87f839add969de90f63e9a09f662686dce4;p=fsnotify.git BSD - Now receive events for created directories --- 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)