Best Technique for Watched folders ?
Best Technique for Watched folders ?
- Subject: Best Technique for Watched folders ?
- From: Mark Gilbert <email@hidden>
- Date: Tue, 5 May 2009 21:04:31 +0100
Folks.
For the 3rd time in my life I am about to start writing folder
watching code.
It's one of those things thats easy to do in a half hearted manner,
but somewhat complicated to do in an efficient and comprehensive way.
I thought I might canvas some ideas from other people before I embark
on this next generation.
The key issues seem to be:
- What are we watching for ? - new files, changed files ? renamed
files ?
- How do we find them ? - bulk search, iteration ?
- How do we know which ones have already been processed ? - mod
date ? some kind of flag ?
- How do we know when its safe to 'trigger' on a file which is being
written into the folder ?
- What happens as our folder gets full up....?
- How do we do all this efficiently without hammering the file system
or the CPU ?
I have my own ideas on some of these things, but I wanted to see if
anyone else had a strong point of view.
In particular whether its a good plan to mark files in some way, and
whether this can be keyed automatically into the discovery process.
Also, what is the best discovery process ? I am sure Apple would
tell us to use event notifications rather than polling the folder, but
I have not had much luck figuring out what can be notified and how.
Well, I hope someone out there has some strong views or experience on
this topic, and is willing to share.
Cheers
Mark.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden