Post not yet marked as solved
Post marked as unsolved with 4 replies, 325 views
I would like to get notified, when a specific file gets opened or closed by another application.
I tried different things like DispatchSource, FSEvents and kqueue, but nothing worked. The only option so far is searching for all process ids, that accesses the file with proc_listpidspath (or with the command line tool lsof). Unfortunately I need to use a Timer for this. But checking i. e. every second will need a lot of CPU, so I'm curious, if there is a built in notification in macOS?