]> go.fuhry.dev Git - fsnotify.git/commitdiff
BSD - Now receive events for created directories
authorChris Howey <chris@howey.me>
Sat, 1 Sep 2012 20:09:30 +0000 (15:09 -0500)
committerChris Howey <chris@howey.me>
Sat, 1 Sep 2012 20:09:30 +0000 (15:09 -0500)
fsnotify_bsd.go

index c1ec73d783aa76419e5f537d355d8c4956ddfa98..5ddf57841dc33410d515fe240493032e0e4c9164 100644 (file)
@@ -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)