OK: I\'m implementing File Sharing in an iPhone OS app, and of course this means filesystem monitoring. Yay!
Basically, the OS copies and/or deletes from and to a di
This is only a partial answer, but might be somewhat useful.
The kqueue mechanism indeed does work as a means to be notified when an app's Documents directory is modified.
The notification comes as soon as the directory is modified and before copying a file is complete. I have observed this in testing.
Unfortunately, there is no form of notification when the copy is done. At least, none that I have found.
What I hope Apple will realize is there needs to be a notification for "iTunes synch" is done, because this seems to be a general problem.
A loop checking if the new file's modification time is not changing might work, but only most of the time. In some extreme circumstances, iOS can pause to do all kinds of time consuming work of its own in the background.
If there is a way to check if a particular file is open by another process, then this would be enough.
Geoff