]> go.fuhry.dev Git - fsnotify.git/commitdiff
Windows - roll attributes into notify
authorChris Howey <howeyc@gmail.com>
Sat, 31 Mar 2012 00:00:57 +0000 (19:00 -0500)
committerChris Howey <howeyc@gmail.com>
Sat, 31 Mar 2012 00:00:57 +0000 (19:00 -0500)
fsnotify.go
fsnotify_test.go
fsnotify_windows.go

index 1381c2a7d7979d928db8cb12abfd430a119aac2b..023665ebd70faab4798f2deea35be7b8bc711d48 100644 (file)
@@ -19,10 +19,6 @@ func (e *FileEvent) String() string {
                events += "|" + "MODIFY"
        }
 
-       if e.IsAttribute() {
-               events += "|" + "ATTRIB"
-       }
-
        if e.IsRename() {
                events += "|" + "RENAME"
        }
index 797920147fed61f65f6825463e06186697fb0d5d..3561599aa198d86c04b96402a9493b33106358ca 100644 (file)
@@ -255,7 +255,7 @@ func TestFsnotifyAttrib(t *testing.T) {
                for event := range eventstream {
                        // Only count relevant events
                        if event.Name == testDir || event.Name == testFile {
-                               if event.IsAttribute() {
+                               if event.IsModify() {
                                        attribReceived++
                                }
                                t.Logf("event received: %s", event)
index 1af40798255b2f32ec0d7f3fe529bca75234a350..5ab54c0c859298a5c4b9df2a58ea9630ae6dc15c 100644 (file)
@@ -30,13 +30,10 @@ type FileEvent struct {
 func (e *FileEvent) IsCreate() bool { return (e.mask & FS_CREATE) == FS_CREATE}\r
 \r
 // IsDelete reports whether the FileEvent was triggerd by a delete\r
-func (e *FileEvent) IsDelete() bool { return ((e.mask & FS_DELETE) == FS_DELETE || (e.mask & FS_DELETE_SELF) == FS_DELETE_SELF }\r
+func (e *FileEvent) IsDelete() bool { return ((e.mask & FS_DELETE) == FS_DELETE || (e.mask & FS_DELETE_SELF) == FS_DELETE_SELF) }\r
 \r
-// IsModify reports whether the FileEvent was triggerd by a file modification\r
-func (e *FileEvent) IsModify() bool { return (e.mask & FS_MODIFY) == FS_MODIFY }\r
-\r
-// IsAttribute reports whether the FileEvent was triggerd by a change of attributes\r
-func (e *FileEvent) IsAttribute() bool { return (e.mask & FS_ATTRIB) == FS_ATTRIB }\r
+// IsModify reports whether the FileEvent was triggerd by a file modification or attribute change\r
+func (e *FileEvent) IsModify() bool { return ((e.mask & FS_MODIFY) == FS_MODIFY || (e.mask & FS_ATTRIB) == FS_ATTRIB) }\r
 \r
 // IsRename reports whether the FileEvent was triggerd by a change name\r
 func (e *FileEvent) IsRename() bool { return ((e.mask & FS_MOVE) == FS_MOVE || (e.mask & FS_MOVE_SELF) == FS_MOVE_SELF || (e.mask & FS_MOVED_FROM) == FS_MOVED_FROM || (e.mask & FS_MOVED_TO) == FS_MOVED_TO) }\r