Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #81 from gophertown/typos
Browse files Browse the repository at this point in the history
fix a few typos
  • Loading branch information
howeyc committed Jan 17, 2014
2 parents 494ebc7 + 733890b commit 5d4501a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion fsnotify.go
Expand Up @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions fsnotify_bsd.go
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions fsnotify_linux.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5d4501a

Please sign in to comment.