Notification of file system modification arrives too early?
Notification of file system modification arrives too early?
- Subject: Notification of file system modification arrives too early?
- From: Antonio Nunes <email@hidden>
- Date: Fri, 28 May 2010 11:05:12 +0100
Hi,
My app is set to observe a folder for changes to its contents (using UKKQueue. Thanks Uli! :-)). When files are dropped into the folder the app is notified and processes the files. This works well, except for one catch: sometimes we receive the notification and spawn the worker thread, and trying to load the file fails ( [[PDFDocument alloc] initWithURL:sourceURL] returns nil). This seems to happen predominantly with large files. I get the impression the notification happens as soon as the file transfer into the watched directory begins, and my worker thread is ready and starts loading the file before it has been fully transferred. Hence the failure to create a PDFDocument from the file.
Is there a way to check whether the file has been fully transferred, or, even better, to get notified only when the file transfer has been completed?
António
-----------------------------------------------------------
What you have inside you expresses itself through both your
choice of words and the level of energy you assign to them.
The more healed, whole and connected you feel inside,
the more healing your words will be.
--Rita Goswami
-----------------------------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden