-
Notifications
You must be signed in to change notification settings - Fork 47
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
Are ES_EVENT_TYPE_NOTIFY_WRITE events triggered by iCloud (bird etc) or any better way to log them? #7
Comments
leaving this crosspost here as well: Any sane way to log iCloud Drive file activity? - Ask Different |
Just a comment, all those e_types are not logged currently by filemonitor. Just some of them. Check source. Just in csse you were expecting events from permission changes etc. |
Thanks @tigersoul925 - I'm on Ventura now so there's a built in tool called |
Oh wow I was NOT aware of eslogger and it looks great as I potentielly could get updates of permission changes etc as well now which filemonitor does not support. How is your experience with eslogger? Does it work well? It seems in the man pages that it isn't really meant for true usage:
|
It's a great tool, has helped me a lot and works fine. I think the warning is to discourage people from lazily forking out to it from inside their apps instead of properly interfacing with the ESF API. |
I see. Got to try it soon. Sounds great. Just a shame it didn't appear earlier. |
I've been trying to use FileMonitor to track down a really annoying and elusive bug with 0-byte files (files getting spuriously emptied and losing their data). I'm trying to trigger this bug while FileMonitor is running, and I'm seeing some weird behavior where it seems as if iCloud's daemons (
bird
and whatever other daemons run in the background and handle iCloud file sync) are able to modify the filesystem right under the nose of tools like FileMonitor.Here's a POC script for testing - requires jq (
brew install jq
)poor-mans-fsusage.sh
Running this script and then creating/updating the
xyzzy.txt
file at the root of iCloud Drive with common tools like Sublime Text,echo foo >>xyzzy.txt
orrm xyzzy.txt
produces output like this:However, if I open this file up on my iPhone (using Files.app) and modify it there, a strange thing happens. No
ES_EVENT_TYPE_NOTIFY_WRITE
events are seen. Yet the file somehow gets updated. It appears that maybe there is some sort of atomic saving going on (temp file saving, moving (renaming) the original, replacing etc. But I can't be sure. Here's a sample of the output:If I change the filtering to log all
NOTIFY_WRITE
s, I get a flurry of activity (I de-duped all the log lines below otherwise it would be pages long)output:
So it looks like a bunch of other helpers are involved in a simple file update on iCloud. I see
nsurlsessiond
,cloudd
,nehelper
... is there any sane way to log this type of activity?The text was updated successfully, but these errors were encountered: