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

Commit 449a337

Browse files
committed
Linux - Add IN_MOVED_TO by request, Issue #25
1 parent c948ea8 commit 449a337

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: fsnotify_linux.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ type FileEvent struct {
2424
}
2525

2626
// IsCreate reports whether the FileEvent was triggerd by a creation
27-
func (e *FileEvent) IsCreate() bool { return (e.mask & IN_CREATE) == IN_CREATE }
27+
func (e *FileEvent) IsCreate() bool {
28+
return (e.mask&IN_CREATE) == IN_CREATE || (e.mask&IN_MOVED_TO) == IN_MOVED_TO
29+
}
2830

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

257-
OS_AGNOSTIC_EVENTS = IN_MOVED_FROM | IN_CREATE | IN_ATTRIB | IN_MODIFY | IN_MOVE_SELF | IN_DELETE | IN_DELETE_SELF
259+
OS_AGNOSTIC_EVENTS = IN_MOVED_TO | IN_MOVED_FROM | IN_CREATE | IN_ATTRIB | IN_MODIFY | IN_MOVE_SELF | IN_DELETE | IN_DELETE_SELF
258260

259261
// Special events
260262
IN_ISDIR uint32 = syscall.IN_ISDIR

0 commit comments

Comments
 (0)