func (es *EventStream) Start() {
	if es.Events == nil {
		es.Events = make(chan []Event)
	}
	cbInfo := registry.Add(es)
	es.registryID = cbInfo
	es.uuid = GetDeviceUUID(es.Device)
	es.start(es.Paths, cbInfo)
}
Start listening to an event stream.
package fsevents
import (
	"sync"
	"syscall"
	"time"
)
type CreateFlags uint32
const (
	useCFTypes CreateFlags = 1 << iota
	NoDefer
	WatchRoot
	IgnoreSelf
	FileEvents
)
type EventFlags uint32
const (
	MustScanSubDirs EventFlags = 1 << iota
	UserDropped
	KernelDropped
	EventIDsWrapped
	HistoryDone
	RootChanged
	Mount
	Unmount
	ItemCreated
	ItemRemoved
	ItemInodeMetaMod
	ItemRenamed
	ItemModified
	ItemFinderInfoMod
	ItemChangeOwner
	ItemXattrMod
	ItemIsFile
	ItemIsDir
	ItemIsSymlink
)
type Event struct {
	Path  string
	Flags EventFlags
	ID    uint64
}
func DeviceForPath(path string) (int32, error) {
	stat := syscall.Stat_t{}
	if err := syscall.Lstat(path, &stat); err != nil {
		return 0, err
	}
	return stat.Dev, nil
}
type EventStream struct {
	stream       FSEventStreamRef
	rlref        CFRunLoopRef
	hasFinalizer bool
	registryID   uintptr
	uuid         string
	Events  chan []Event
	Paths   []string
	Flags   CreateFlags
	EventID uint64
	Resume  bool
	Latency time.Duration
	Device int32
}
type eventStreamRegistry struct {
	sync.Mutex
	m      map[uintptr]*EventStream
	lastID uintptr
}
var registry = eventStreamRegistry{m: map[uintptr]*EventStream{}}
func (r *eventStreamRegistry) Add(e *EventStream) uintptr {
	r.Lock()
	defer r.Unlock()
	r.lastID++
	r.m[r.lastID] = e
	return r.lastID
}
func (r *eventStreamRegistry) Get(i uintptr) *EventStream {
	r.Lock()
	defer r.Unlock()
	return r.m[i]
}
func (r *eventStreamRegistry) Delete(i uintptr) {
	r.Lock()
	defer r.Unlock()
	delete(r.m, i)
}