Re: Watching folders for new files and event handling based on that?
Re: Watching folders for new files and event handling based on that?
- Subject: Re: Watching folders for new files and event handling based on that?
- From: Gregory Weston <email@hidden>
- Date: Fri, 10 Aug 2007 20:06:13 -0400
Alastair Houghton wrote:
Is there any support within the cocoa frameworks for watching
folders for new files being added and so forth?
For many purposes you can avoid needing this functionality completely
with a little thought. For instance, say you're displaying files to
the user (like Finder does). In that case, a good technique is to
refresh your view every time the user activates your window. That
way, if they switch to another app and save something, you're
guaranteed to notice it at just the right time.
I think it'd be a rare case where that's a really useful solution, to
be honest. It's entirely possible for the contents of a directory to
be changed by a background app. What happens if you're monitoring the
user's download directory while Safari's in the middle of a 35MB
download. This mechanism won't notice when the .download package gets
replaced by the actual retrieved file.
G
_______________________________________________
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