监控文件当前是否已打开Mac App

时间:2015-06-16 22:42:50

标签: objective-c macos

我的应用在FS上创建一个文件,并在其他应用程序中打开该文件。我想监视文件中已有的更改,但我也想知道其他应用程序何时关闭了文件。 Mac上是否存在一些API,它是一个不会让我的应用从应用商店中被拒绝的API?

1 个答案:

答案 0 :(得分:1)

我相信您正在寻找的东西是FSEvents(文件系统事件),特别是FSEventStreamCreate functionFSEventStreamEventFlag kFSEventStreamEventFlagItemModified

As long as it's a file within the user's sandbox (or one that the user has given permission to use),我认为你应该对app商店没问题。

可以找到更多信息in this related question