OSXFuse - How to distinguish open file from preview in Finder

282 views Asked by At

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

There are 1 answers

0
Mugen On

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.