]> go.fuhry.dev Git - fsnotify.git/commitdiff
fix a few typos
authorNathan Youngman <git@nathany.com>
Thu, 16 Jan 2014 04:58:23 +0000 (21:58 -0700)
committerNathan Youngman <git@nathany.com>
Thu, 16 Jan 2014 04:58:23 +0000 (21:58 -0700)
fsnotify.go
fsnotify_bsd.go
fsnotify_linux.go

index f371960298fbd4221425fb2240ddaef4587cce71..86a080b1113ba818d60636cb16f65f6d316cb84f 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package fsnotify implements filesystem notification.
+// Package fsnotify implements file system notification.
 package fsnotify
 
 import "fmt"
index 416382d2dfbbd72a5161a7ab4f07a9eb39e0613d..c7ca0173db42169537af3ce4652cd7f72e504c86 100644 (file)
@@ -56,7 +56,7 @@ func (e *FileEvent) IsRename() bool { return (e.mask & sys_NOTE_RENAME) == sys_N
 type Watcher struct {
        mu              sync.Mutex          // Mutex for the Watcher itself.
        kq              int                 // File descriptor (as returned by the kqueue() syscall)
-       watches         map[string]int      // Map of watched file diescriptors (key: path)
+       watches         map[string]int      // Map of watched file descriptors (key: path)
        wmut            sync.Mutex          // Protects access to watches.
        fsnFlags        map[string]uint32   // Map of watched files to flags used for filter
        fsnmut          sync.Mutex          // Protects access to fsnFlags.
@@ -66,9 +66,9 @@ type Watcher struct {
        finfo           map[int]os.FileInfo // Map of file information (isDir, isReg; key: watch descriptor)
        pmut            sync.Mutex          // Protects access to paths and finfo.
        fileExists      map[string]bool     // Keep track of if we know this file exists (to stop duplicate create events)
-       femut           sync.Mutex          // Proctects access to fileExists.
+       femut           sync.Mutex          // Protects access to fileExists.
        externalWatches map[string]bool     // Map of watches added by user of the library.
-       ewmut           sync.Mutex          // Protects access to internalWatches.
+       ewmut           sync.Mutex          // Protects access to externalWatches.
        Error           chan error          // Errors are sent on this channel
        internalEvent   chan *FileEvent     // Events are queued on this channel
        Event           chan *FileEvent     // Events are returned on this channel
@@ -280,7 +280,7 @@ func (w *Watcher) removeWatch(path string) error {
                }
                w.pmut.Unlock()
                for idx := 0; idx < len(pathsToRemove); idx++ {
-                       // Since these are internal, not much sense in propogating error
+                       // Since these are internal, not much sense in propagating error
                        // to the user, as that will just confuse them with an error about
                        // a path they did not explicitly watch themselves.
                        w.removeWatch(pathsToRemove[idx])
@@ -340,7 +340,7 @@ func (w *Watcher) readEvents() {
                        }
                }
 
-               // Flush the events we recieved to the events channel
+               // Flush the events we received to the events channel
                for len(events) > 0 {
                        fileEvent := new(FileEvent)
                        watchEvent := &events[0]
@@ -430,7 +430,7 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error {
                                return e
                        }
                } else {
-                       // If the user is currently waching directory
+                       // If the user is currently watching directory
                        // we want to preserve the flags used
                        w.enmut.Lock()
                        currFlags, found := w.enFlags[filePath]
@@ -456,7 +456,7 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error {
 
 // sendDirectoryEvents searches the directory for newly created files
 // and sends them over the event channel. This functionality is to have
-// the BSD version of fsnotify mach linux fsnotify which provides a
+// the BSD version of fsnotify match linux fsnotify which provides a
 // create event for files created in a watched directory.
 func (w *Watcher) sendDirectoryChangeEvents(dirPath string) {
        // Get all files
index 79b0ec5cb03dfdb81e34d6913d51838700c5f69a..48f89af1ae2a7eb47e8ae4e0d12851b4c9eaf594 100644 (file)
@@ -65,22 +65,22 @@ type FileEvent struct {
        Name   string // File name (optional)
 }
 
-// IsCreate reports whether the FileEvent was triggerd by a creation
+// IsCreate reports whether the FileEvent was triggered by a creation
 func (e *FileEvent) IsCreate() bool {
        return (e.mask&sys_IN_CREATE) == sys_IN_CREATE || (e.mask&sys_IN_MOVED_TO) == sys_IN_MOVED_TO
 }
 
-// IsDelete reports whether the FileEvent was triggerd by a delete
+// IsDelete reports whether the FileEvent was triggered by a delete
 func (e *FileEvent) IsDelete() bool {
        return (e.mask&sys_IN_DELETE_SELF) == sys_IN_DELETE_SELF || (e.mask&sys_IN_DELETE) == sys_IN_DELETE
 }
 
-// IsModify reports whether the FileEvent was triggerd by a file modification or attribute change
+// IsModify reports whether the FileEvent was triggered by a file modification or attribute change
 func (e *FileEvent) IsModify() bool {
        return ((e.mask&sys_IN_MODIFY) == sys_IN_MODIFY || (e.mask&sys_IN_ATTRIB) == sys_IN_ATTRIB)
 }
 
-// IsRename reports whether the FileEvent was triggerd by a change name
+// IsRename reports whether the FileEvent was triggered by a change name
 func (e *FileEvent) IsRename() bool {
        return ((e.mask&sys_IN_MOVE_SELF) == sys_IN_MOVE_SELF || (e.mask&sys_IN_MOVED_FROM) == sys_IN_MOVED_FROM)
 }