Skip to content

Commit ba99ec5

Browse files
committed
Remove support for old Go versions
Fixes #51
1 parent 3899270 commit ba99ec5

6 files changed

Lines changed: 20 additions & 81 deletions

File tree

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
go 1.16
2+
13
module github.com/fsnotify/fsevents

go_1_10_after.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

go_1_10_before.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

go_1_9_2_after.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

go_1_9_2_before.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

wrap.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ const (
9191
FileEvents = CreateFlags(C.kFSEventStreamCreateFlagFileEvents)
9292
)
9393

94-
9594
// EventFlags passed to the FSEventStreamCallback function.
9695
// These correspond directly to the flags as described here:
9796
// https://developer.apple.com/documentation/coreservices/1455361-fseventstreameventflags
@@ -227,6 +226,24 @@ const (
227226
ItemIsSymlink = EventFlags(C.kFSEventStreamEventFlagItemIsSymlink)
228227
)
229228

229+
const (
230+
nullCFStringRef = C.CFStringRef(0)
231+
nullCFUUIDRef = C.CFUUIDRef(0)
232+
233+
// eventIDSinceNow is a sentinel to begin watching events "since now".
234+
eventIDSinceNow = uint64(C.kFSEventStreamEventIdSinceNow)
235+
)
236+
237+
// GetDeviceUUID retrieves the UUID required to identify an EventID
238+
// in the FSEvents database
239+
func GetDeviceUUID(deviceID int32) string {
240+
uuid := C.FSEventsCopyUUIDForDevice(C.dev_t(deviceID))
241+
if uuid == nullCFUUIDRef {
242+
return ""
243+
}
244+
return cfStringToGoString(C.CFUUIDCreateString(C.kCFAllocatorDefault, uuid))
245+
}
246+
230247
// LatestEventID returns the most recently generated event ID, system-wide.
231248
func LatestEventID() uint64 {
232249
return uint64(C.FSEventsGetCurrentEventId())

0 commit comments

Comments
 (0)