Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6967

QFileSystemWatcher won't emit signals for directory with opened descriptors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • 4.7.0
    • 4.5.3
    • Core: I/O
    • None
    • Debian Lenny 5.0.3, Qt 4.5.3 from testing

    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
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            dmitry64 Dmitry
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes