[Gambas-user] Pb instanciating inotify watch

T Lee Davidson t.lee.davidson at gmail.com
Thu Mar 7 07:27:13 CET 2019


On 3/7/19 1:16 AM, Tobias Boege wrote:
> As far as I can see, you replaced
> 
>    hWatch.Events[Watch.Create] = True
>    hWatch.Events[Watch.Delete] = True
> 
> by
> 
>    hWatch.Events[Watch.Delete Or Watch.Create] = True
> 
> Having to do this comes almost surely from a bug! It should be possible
> to set events independently, because otherwise why would we have an
> array accessor syntax for them instead of just a bitmask property?
> 
> The current implementation was done in the redesign phase mentioned
> earlier in this thread and it doesn't use the RHS of the assignment
> at all (try assigning False to .events[Watch.Create Or Watch.Delete],
> it'll still work). That's a very strong sign it's an oversight bug.
> I'm going to fix it, then fix the wiki example because why are you
> watching "/" and observing changes?
> 
> Regards,
> Tobi

Just FYI, Tobi, the documentation [0] mentions that the Events argument for the property signature ("hWatch.Events [ Events As 
Integer ] = aBoolean) should be a bitwise Or'd set:

"Turn monitoring on a non-empty set (bitwise OR'd) of Watch constants on or off."

[0] http://gambaswiki.org/wiki/comp/gb.inotify/.watch.events/_put

I don't know if that makes any difference to your conclusion.


___
Lee



More information about the User mailing list