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

QFileSystemWatcher locks directory on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.2.1
    • None
    • Windows 7

    Description

      I am watching a directory recursively using QFileSystemWatcher. And I am not able to rename/delete the parent directory either programmatically or manually if its sub directories are being watched.

      When trying to rename manually through system i get a message box saying "The action cannot be completed because the folder/ file in it is opened in another program" and on renaming programmatically it fails.

      I got these similar bugs, but no resolution:

      http://qt-project.org/forums/viewthread/10530

      https://bugreports.qt-project.org/browse/QTBUG-7905

      I am not watching . and .. as said in the above link, but still the directory is locked.

      In case of programmatically renaming.. I tried a workaround:
      1. Remove all the subdirectory paths from watcher before renaming the parent.
      2. Rename parent.
      3. Add subdirectory paths again.

      But here too my program fails on first step. QFileSystemWatcher::removePath() returns false when trying to remove the subdirectory paths, and QFileSystemWatcher::directories() show that directory in the paths being watched. Same as posted here https://bugreports.qt-project.org/browse/QTBUG-10846

      Since step 1 fails here, step 2 also fails and i cannot rename the parent dir.

      I am using Qt5.2.1 and Windows 7.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            nehagupta Neha Gupta
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes