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: Alastair Houghton <email@hidden>
- Date: Sat, 11 Aug 2007 09:44:32 +0100
On 11 Aug 2007, at 08:39, Uli Kusterer wrote:
1) A user may be waiting for the download to finish with your
window open, then decide to play a round of Mine S^H^H^H
Solit^H^H^H Chess, glancing over at your background window
occasionally to see whether the download's finished. If you don't
update until it's activated, your window will not update correctly.
The solution I mentioned probably wouldn't be appropriate---on its
own---for a Finder replacement, but it should be fine for many
applications. I agree that sometimes it would be better to wait a
short time before updating (to avoid the double-click problem you
mention), and that paying attention to the NSWorkspace notifications
would be a good idea (which I think will deal with your download
situation without resorting to kqueue). And obviously you wouldn't
just update one window in your app if two of them happen to be
pointing at that folder.
3) This is only possible if your view will already be open. With an
app like Hazel, that generally watches your folders in the
background, that won't work.
Sure. It doesn't solve 100% of problems. But it also doesn't rely
on a feature that won't work with network filesystems (and far too
many people currently don't test this case, I might add); it also
scales much better than (for instance) kqueue for some purposes,
because to use the latter you have to open file descriptors for each
monitored folder.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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