diff --git a/fsnotify.go b/fsnotify.go index dd26714..6d1ccbe 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -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" diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index 509ac79..05f657e 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -62,7 +62,7 @@ func (e *FileEvent) IsAttrib() bool { 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. @@ -72,9 +72,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 @@ -286,7 +286,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]) @@ -346,7 +346,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] @@ -436,7 +436,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] @@ -462,7 +462,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 diff --git a/fsnotify_linux.go b/fsnotify_linux.go index 39c970d..538020e 100644 --- a/fsnotify_linux.go +++ b/fsnotify_linux.go @@ -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) }