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

QFileSystemWatcher problems with external drives on Mac.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.4.1
    • Core: I/O
    • None
    • macOS

    Description

      Calling QFileSystemWatcher::addPath() on an external volume does not work as expected when the volume is FAT32. Instead the following lines are printed :

      QKqueueFileSystemWatcherEngine::addPaths: kevent: Operation not supported
      QFileSystemWatcher: failed to add paths: /Volumes/ANDYSIPOD/Test/foo.txt

      This can be seen with the following example :

      #include <QtGui>
      class TestFileSystemWatcher : public QMainWindow
      {
      Q_OBJECT
      public:
      TestFileSystemWatcher(QWidget *parent = 0, Qt::WFlags flags = 0);
      private slots:
      void directoryChanged(const QString & path);
      void fileChanged(const QString & path);
      };

      TestFileSystemWatcher::TestFileSystemWatcher(QWidget *parent, Qt::WFlags flags)
      : QMainWindow(parent, flags)
      {
      QFileSystemWatcher *FileSystemWatcher = new QFileSystemWatcher();
      connect(FileSystemWatcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(directoryChanged(const QString &)));
      connect(FileSystemWatcher, SIGNAL(fileChanged(const QString &)), this, SLOT(fileChanged(const QString &)));

      //seems to work OK
      //FileSystemWatcher->addPath("/Users/ddettman/tasks/223845/testfile.txt");

      //errors

      FileSystemWatcher->addPath("/Volumes/ANDYSIPOD/Test/foo.txt");

      //here are the errrors on mac:
      // QKqueueFileSystemWatcherEngine::addPaths: kevent: Operation not supported
      // QFileSystemWatcher: failed to add paths: /Volumes/ANDYSIPOD/Test/foo.txt

      }

      void TestFileSystemWatcher::directoryChanged(const QString & path)
      {
      qDebug("directoryChanged");
      }

      void TestFileSystemWatcher::fileChanged(const QString & path)
      {
      qDebug("fileChanged");
      }

      #include "main.moc"
      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);
      TestFileSystemWatcher w;
      w.show();
      return a.exec();
      }

      Attachments

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

        Activity

          People

            richard Richard Moe Gustavsen
            dettman Dean Dettman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes