macfsevents
macfsevents copied to clipboard
How to know when Observer is ready ?
Hello
I'm trying to develop software with your API. For some reason I want to know when the initialization of watchers is finished. Currently, I didn't find how to do that. First of all I wanted to know if it's possible, and if it's not I just added a boolean in Observer object and set it to true at the end of function run before loop(). This work but does this seem correct for you?
Thank you for your time and sorry for my bad English
I'm not sure it's possible directly, but the FSEvents API supports historic events via the sinceWhen
argument. That is, you could simply provide a sinceWhen
value of the current time and then you ought to get all events if if the actual events stream takes some time to set up.
That said, macfsevents
does not currently forward since parameter.
Thank you, I am going to look at that. And what do you thing about the addition of the flag in fsevents.py in Observer ?
I think it would be great to have that flag; unfortunately, I'm not on a Mac right now, so I can't really test it out.
Ok, let me know after your test Have a good day.
If you set file_events = True, it will take a snapshot (os.walk) on all the paths, this might take forever on large folder. If you don't use file_events, you can only know the PARENT path of the file in changes, then, since the file is already change, you will have no idea which file is changed in that folder and what kind of change is that, this is quite annoying, am I doing something wrong here ? , using the example, I can only get event arguments (path, 0,)