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

QFileSystemWatcher doesn't notify of symbolic link deletions on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Invalid
    • Affects Version/s: 5.3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Win7 x64 and Linux 3.2.0-49-generic-pae #75-Ubuntu SMP Tue Jun 18 18:00:21 UTC 2013 i686 i686 i386 GNU/Linux

      Description

      If I create symbolic link and watch that link, then delete the link (the link's target exists and remains unchanged the entire time), I get a notification on deletion on Windows (Win7 x64), but not on Linux.

      Here's some code that uses the Qt Test framework:

      // Note: must create a symlink called "symlink" on disk in the current folder before running
      
      QFileSystemWatcher watcher;
      QStringList changedList;
      QFileSystemWatcher::connect( &watcher, &QFileSystemWatcher::fileChanged, [&]( const QString& filename ) { changedList.push_back( filename ); } );
      watcher.addPath( "symlink" );
      QTest::qWait( 100 ); // Let events flow through
      
      // Remove a link
      std::remove( "symlink" );
      QTest::qWait( 100 ); // Let events flow through
      
      // Check the result
      QCOMPARE( 0, watcher.files().size() );
      QCOMPARE( 1, changedList.size() );
      QCOMPARE( "symlink", changedList[0] );
      
      

      This passes on Win7 but fails on Linux.

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                thiago Thiago Macieira
                Reporter:
                mlimber mlimber
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes