问题
I'm trying to get the File System Event notifications in Mac for my Application. When i was googling about FSEvents, noticed Dropbox is also using FSEvents and it's asking for administrator privileges to run "dbfseventsd" process. Do i also need to have Administrator privileges for my Application to monitor changes in a Directory ..?
回答1:
From apple's Documentation
File System Permissions and File System Events
The most obvious security concern related to file system events is one of privacy. If Bob can see a list of events from changes to Alice’s home directory, Bob might see things that Alice does not want him to see. For example, Alice might have a directory name that coincides with the code name of an unreleased Apple product.
To prevent this potential security leak, users do not receive any events unless the user can reach the modified directory through standard file system permissions.
Note: As a side effect, event IDs presented to a file system events client will not necessarily be consecutive even if the user is monitoring all events on all directories beginning at the root. Only applications running as the root user can be guaranteed to receive all events.
来源:https://stackoverflow.com/questions/12404510/do-i-need-administrator-privileges-to-monitor-files-in-mac-using-fsevents