I have a kQueue observer on the Documents directory in my app. I am using the kQueue that triggers a callback when the Documents directory contents changes.
here are two of the settings
eventToAdd.flags = EV_ADD | EV_CLEAR;
eventToAdd.fflags = NOTE_WRITE;
The problem is that I get notified when the contents changed when a new file is added, but the actual file is not completely copied yet, so when I try process the new file I get a SIGABRT crash.
How can I delay the notification until the file is completed?