Search code examples
iphonecocoa-touchioskqueue

On iOS, how can an app determine if a file is no longer being written to by another process?


My question is very similar to this one: What is the optimal way to monitor changes in a directory with a kqueue()? but I'm not satisfied with the answer there.

I have a kqueue setup to be notified when a file is copied to my app's Documents directory. Of course the notification fires as soon as the copying begins, but I want to know when it's completed. Surely there's a better way than polling modification times?


Solution

  • For now, the answer seems to be 'no', so I've resorted to polling the modification time of the file(s) in question.

    If someone else is able to come up with a better answer, I'd be glad to hear it (and will un-accept this one).