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

Question for what program did modification #14

Closed
potmo opened this issue Aug 23, 2020 · 1 comment
Closed

Question for what program did modification #14

potmo opened this issue Aug 23, 2020 · 1 comment
Labels

Comments

@potmo
Copy link

potmo commented Aug 23, 2020

Hi, great lib!

I'm making an application that continually saves state-files to disk. I'd like to be able to use e.g. a DropBox folder as storage. If the files is modified from another computer and synched with dropbox i'd like to get a notification so I can reload my cached in app state. I would like to filter away my own local modifications and only get notified by other processes modifications. Is it possible to somehow get what process that modified the file? It would be nice to not have to constantly read the files after modifications and compare them to my local cache.

@daniel-pedersen
Copy link
Owner

daniel-pedersen commented Oct 26, 2020

It's not possible with kqueue to get the process that did a modification. You'd have to implement it yourself, but it sounds like you should be able to. You can filter out your own changes by either removing, writing changes, then re-adding the path every time you do a change, otherwise you have to implement some custom filtering in the change handler.

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

No branches or pull requests

2 participants