[Development] QFileSystemWatcher and Recursive Monitoring
robertknight at gmail.com
Fri Jul 20 11:37:10 CEST 2012
> With FSEvents you cannot emit signals such as fileChanged(), fileModified(),
> pathCreated(), or pathDeleted() if all you're notified about is that
> "something happened in this folder here",
>From my experience building an app that 'watches' a folder and imports
all files of a certain type
added there, I would prefer that QFSW was simple and reliable and
to impose a heavy cost or internal complexity (which translates into
bugs) for things
that the underlying APIs do not really support - leaving it up to the
app to decide how
best to handle these limitations.
As you say, applications which are watching (possibly large) directory
trees will likely
have their own database of content which they will compare any changes
to. The app
can optimize this in domain-specfic ways, such as not recording any
types of files it doesn't care about.
Here is the FSEvents wrapper we use on Mac for example:
If the underlying APIs for fine-grained notifications and broad file
system watches are quite different (as is the case for Mac),
I think it makes sense not to try and 'paper over' that in the Qt
APIs, so providing different classes would be better.
> Would be easiest to implement, we could even drop all the threading currently there now.
There is a lot to be said for internal simplicity, especially where
threading is concerned.
On 20 July 2012 06:28, logic.cpp <logic.cpp at gmail.com> wrote:
> Clarification of original post:
> When I say "Making QFileSystemWatcher Recursive" I mean *adding* new functions
> for recursive monitoring, such as "addPathRecursively()". I don't mean to
> replace the current non-recursive functinality, which is very useful in its own
> right (for "A" category use cases mentioned).
> Development mailing list
> Development at qt-project.org
More information about the Development