From: Nathan Youngman Date: Fri, 20 Jun 2014 02:55:57 +0000 (-0600) Subject: Event struct has the same definition across every OS X-Git-Tag: v1.7.2~311^2~1 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=fbde1f2b6ff610b4e022a96f2ef92c7ca1389527;p=fsnotify.git Event struct has the same definition across every OS --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 6da0c9a..c40479b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ ## v0.12.0 / 2014-06-19 -* use syscall.ERROR_MORE_DATA from ztypes_windows (Go 1.3+) -* [internal] remove cookie from Event struct (unused) +* Go 1.3+ required on Windows (uses syscall.ERROR_MORE_DATA internally). +* [internal] remove cookie from Event struct (unused). +* [internal] Event struct has the same definition across every OS. ## v0.11.0 / 2014-06-12 diff --git a/fsnotify.go b/fsnotify.go index 22e105e..200e61a 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -7,6 +7,12 @@ package fsnotify import "fmt" +// Event represents a single file system event. +type Event struct { + Name string // Relative path to the file/directory. + Op Op // Platform-independent bitmask. +} + // Op describes a set of file operations. type Op uint32 diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index 24af821..549b9e4 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -33,11 +33,6 @@ const ( keventWaitTime = 100e6 ) -type Event struct { - Name string // Relative path to the file/directory. - Op Op // Platform-independent mask. -} - func newEvent(name string, mask uint32, create bool) *Event { e := new(Event) e.Name = name diff --git a/fsnotify_linux.go b/fsnotify_linux.go index f9be710..1864824 100644 --- a/fsnotify_linux.go +++ b/fsnotify_linux.go @@ -56,11 +56,6 @@ const ( sys_IN_UNMOUNT uint32 = syscall.IN_UNMOUNT ) -type Event struct { - Name string // Relative path to the file/directory. - Op Op // Platform-independent mask. -} - func newEvent(name string, mask uint32) *Event { e := &Event{Name: name} if mask&sys_IN_CREATE == sys_IN_CREATE || mask&sys_IN_MOVED_TO == sys_IN_MOVED_TO { diff --git a/fsnotify_windows.go b/fsnotify_windows.go index 8896edf..77ba5e9 100644 --- a/fsnotify_windows.go +++ b/fsnotify_windows.go @@ -41,13 +41,6 @@ const ( sys_FS_Q_OVERFLOW = 0x4000 ) -// Event is the type of the notification messages -// received on the watcher's Events channel. -type Event struct { - Name string // Relative path to the file/directory. - Op Op // Platform-independent bitmask. -} - func newEvent(name string, mask uint32) *Event { e := &Event{Name: name} if mask&sys_FS_CREATE == sys_FS_CREATE {