Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to know when Observer is ready ? #20

Open
happygts opened this issue Mar 31, 2014 · 5 comments
Open

How to know when Observer is ready ? #20

happygts opened this issue Mar 31, 2014 · 5 comments

Comments

@happygts
Copy link
Contributor

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

@malthe
Copy link
Owner

malthe commented Mar 31, 2014

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.

@happygts
Copy link
Contributor Author

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 ?

@malthe
Copy link
Owner

malthe commented Mar 31, 2014

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.

@happygts
Copy link
Contributor Author

Ok, let me know after your test
Have a good day.

@curlyz
Copy link

curlyz commented Jan 25, 2021

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,)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants