Suitable API to watch for directory/file change events on iOS

Good day. I'm working on a backup-app, that needs to watch a large directory tree on iOS.

On macOS we have FSEvents API, which, I understand, is suitable for the task, but not available on iOS.

So I opted to try GCD DispatchSource - works, but needs to open descriptors for every watched dir in the tree to receive events. I've hit the open-file limit (256).

There's still at least a third option of trying endpoint-security api, but that seems to be a massive overkill.

?> Is there a way to increase the open-file limit for the app? If no - maybe I'm missing some other api to use for the task? I do not need to distribute the app in store.

I'm working on a backup-app, that needs to watch a large directory tree on iOS.

Is this directory hierarchy within your app’s container? Or have you got access to it otherwise, for example, using one of the document access APIs?

There's still at least a third option of trying endpoint-security api

ES is also a macOS-only thing.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is this directory hierarchy within your app’s container? Or have you got access to it otherwise, for example, using one of the document access APIs?

No - the tree is question is users Documents / Mobile Documents (.../mobile/Library/Mobile%20Documents/comappleCloudDocs/Documents), the access is gained via security scoped urls (I guess it is document api). I wonder if I can just add the relevant entitlements to the app / skip the sandboxing altogether - it will be distributed in-house only.

The main problem however is still the open-file limit (if no other API can be used for the task)

Suitable API to watch for directory/file change events on iOS
 
 
Q