QFileSystemWatcher

From qtnode

Jump to: navigation, search
preview icon This article documents a Technology Preview.
Information may change rapidly as the final release date nears.

Contents

Implementation Details of Note

The details below may be of some interest to evaluate performance and scalability. If there isn't a native method available to report on a file or directory change, then Qt uses a thread to poll every one second for changes on watched items.

Linux

QFileSystemWatcher will use inotify in supported kernel versions, determined by having the required syscall numbers at your application's runtime.

Starting with the 2.6.13 Linux kernel, inotify support is included. There is also a patch in the Linux Kernel Archives for earlier versions of the 2.6 kernel. But if using a patched kernel, use the latest patch to ensure it uses system calls instead of just the character device /dev/inotify, which uses fcntl instead.

Also note that if Qt was compiled with QT_LSB defined, to make Qt conform to the Linux Standard Base, then it won't use inotify because syscall isn't standardized by the LSB. A comment from the code states: the LSB doesn't standardize syscall, need to wait until glib2.4 is standardized.

FreeBSD and Mac OS X

This uses kqueue.

Windows

TBD.

Personal tools