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

Commit

Permalink
Linux - Add IN_MOVED_TO by request, Issue #25
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Nov 1, 2012
1 parent c948ea8 commit 449a337
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fsnotify_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ type FileEvent struct {
}

// IsCreate reports whether the FileEvent was triggerd by a creation
func (e *FileEvent) IsCreate() bool { return (e.mask & IN_CREATE) == IN_CREATE }
func (e *FileEvent) IsCreate() bool {
return (e.mask&IN_CREATE) == IN_CREATE || (e.mask&IN_MOVED_TO) == IN_MOVED_TO
}

// IsDelete reports whether the FileEvent was triggerd by a delete
func (e *FileEvent) IsDelete() bool {
Expand Down Expand Up @@ -254,7 +256,7 @@ const (
IN_MOVE_SELF uint32 = syscall.IN_MOVE_SELF
IN_OPEN uint32 = syscall.IN_OPEN

OS_AGNOSTIC_EVENTS = IN_MOVED_FROM | IN_CREATE | IN_ATTRIB | IN_MODIFY | IN_MOVE_SELF | IN_DELETE | IN_DELETE_SELF
OS_AGNOSTIC_EVENTS = IN_MOVED_TO | IN_MOVED_FROM | IN_CREATE | IN_ATTRIB | IN_MODIFY | IN_MOVE_SELF | IN_DELETE | IN_DELETE_SELF

// Special events
IN_ISDIR uint32 = syscall.IN_ISDIR
Expand Down

0 comments on commit 449a337

Please sign in to comment.