.Watch.Events[…] = … (gb.inotify)
Dim hWatch
As Watch
Dim aBoolean
As Boolean
hWatch.Events
[ Events As Integer ] = aBoolean
Turn monitoring of an event, represented by its
Watch constant, on or off. You can combine multiple constants to an event set using bitwise
OR to operate on multiple event subscriptions simultaneously. The subscriptions to events outside the given set are not affected.
The less events you specify, the less frequently the process will be interrupted by the kernel because of some event. So if your program is also intended to do some heavy computations, consider the monitored events carefully. Maybe consider a dedicated
Task.
Example
' Subscribe to Create and Delete events:
hWatch.Events[Watch.Create] = True
hWatch.Events[Watch.Delete] = True
' equivalent and shorter:
hWatch.Events[Watch.Create Or Watch.Delete] = True
' later turning one of them off leaves the other unchanged:
hWatch.Events[Watch.Create] = False