>> I’m not sure how careful that monitoring is, though, whether it happens 
>> continuously, or only at the moment the app or document regains focus.
> 
> Even if it’s continuous, it can’t be continuous enough, since the OS is 
> multithreaded. There’s always the possibility of a race condition where the 
> app tries to access the file after it’s been moved but before the 
> notification arrives. 

I believe an app can use -[NSDocument performSynchronousFileAccessUsingBlock:] 
to avoid such race conditions. At least, I assume so, since NSDocument adopts 
NSFilePresenter and should cope with access from multiple processes (eg: 
Jonathan's app and the Finder).

~Martin Wierschin


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to