问题
I'm using OSXFuse
https://osxfuse.github.io/
And wanted to know if I can tell apart the following operations:
- File is opened by the user
- File is previewed in Finder
My problem is that for both cases readFileAtPath
is called, and seemingly with the same parameters.
回答1:
Apparently this cannot be done using the simple API, as read is read no matter who requests it.
But that's the point, if you could identify who requested to read, you could block it for some processes.
Using Fuse's C api, you could you fuse_get_context()
, and get the pid
, and from it get the process name. No need for more.
See my question at Fuse Google Group.
来源:https://stackoverflow.com/questions/31912769/osxfuse-how-to-distinguish-open-file-from-preview-in-finder