Details
Description
For example, if syslog opens log files in /var/log and writes something to them during work, QFileSystemWatcher won't see that changes.
Steps to reproduce:
#include <QFileSystemWatcher> Class::Class() : QObject() { QFileSystemWatcher *fw = new QFileSystemWatcher(this); connect(fw, SIGNAL(directoryChanged(const QString &)), this, SLOT(slotDirectoryChanged())); fw->addPath("/var/log/"); } ... void Class::slotDirectoryChanged() { qDebug("Directory has been changed"); }
compile and run. In another console do
# logger hello # logger hello
Go back to the first console where watcher runs - you won't see any message from it. Let's test if it works at all. Go back to free console and run
# touch /var/log/test
Go back to the first console where watcher runs - you will see a message from it:
# ./watcher Directory has been changed