Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QFileSystemWatcher problem

    General and Desktop
    3
    8
    1171
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Goffer
      Goffer last edited by Goffer

      Hello community,

      I've tried to use the QFileSystemWatcher to watch changes inside a directory, it works fine on my machine but when I go on a colleague's machine and watch the same directory, he doesn't get notified when I edit the content of this directory but he gets notified when HE edits but then I am not notified anymore ... unless I edit again etc etc

      The directory is writeable by everyone since we can both write in it.

      def test(x):
      	print 'file changed', x
      
      
      from PySide import QtGui, QtCore
      
      fileWatcher = QtCore.QFileSystemWatcher()
      fileWatcher.addPath('/path/to/dir')
      
      
      fileWatcher.directoryChanged.connect(test)
      

      We are on CentOS Gnome 2.28.2

      any idea ?

      Thx

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        Are you modifying files over a network share (nfs) or in what way is the situation different for the editing case
        he/you make changes ?

        As far as i understand QFileSystemWatcher uses inotify and that dont default works with nfs
        https://stackoverflow.com/questions/4231243/inotify-with-nfs

        1 Reply Last reply Reply Quote 2
        • Goffer
          Goffer last edited by Goffer

          Hi @mrjj

          Yes, files are all stored on a shared network
          So, does it mean there is no way to achieve the fileWatcher with Qt if I work on a shared network ?(considering that I am a simple user without any privilege to modify the system)

          Thx

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Goffer last edited by

            @Goffer
            Hi
            only if they fixed that inotify works with NFS as far as i understand it.
            Its 7 years old thread but i google at bit and saw post 4
            years ago having same issues.
            So unless it works now, then i guess it cant work out of the box.
            (unless you make it work)

            Goffer 1 Reply Last reply Reply Quote 0
            • Goffer
              Goffer @mrjj last edited by Goffer

              @mrjj

              Well, I don't have the privileges nor the system knowledge to make it work in my company ...
              I will give it a try with Qt5 if installed, maybe it's working.

              Otherwise, I will look for alternative solutions and post what I find

              Thx for your time ! ;)

              mrjj 1 Reply Last reply Reply Quote 1
              • mrjj
                mrjj Lifetime Qt Champion @Goffer last edited by

                @Goffer
                If you have a linux IT dude there, he might be able to fix it, or know an alternative.

                Goffer 1 Reply Last reply Reply Quote 0
                • Goffer
                  Goffer @mrjj last edited by

                  @mrjj
                  Might be worth asking. Will open a ticket ;)

                  JonB 1 Reply Last reply Reply Quote 0
                  • JonB
                    JonB @Goffer last edited by JonB

                    @Goffer
                    Just to be clear: this is an NFS/inotify issue/limitation, nothing to do with QFileSystemWatcher per se.

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post