Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileSystemWatcher problem
QtWS25 Last Chance

QFileSystemWatcher problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.8k Views
  • 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.
  • GofferG Offline
    GofferG Offline
    Goffer
    wrote on last edited by Goffer
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      2
      • GofferG Offline
        GofferG Offline
        Goffer
        wrote on last edited by Goffer
        #3

        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

        mrjjM 1 Reply Last reply
        0
        • GofferG 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

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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)

          GofferG 1 Reply Last reply
          0
          • mrjjM mrjj

            @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)

            GofferG Offline
            GofferG Offline
            Goffer
            wrote on last edited by Goffer
            #5

            @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 ! ;)

            mrjjM 1 Reply Last reply
            1
            • GofferG 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 ! ;)

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

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

              GofferG 1 Reply Last reply
              0
              • mrjjM mrjj

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

                GofferG Offline
                GofferG Offline
                Goffer
                wrote on last edited by
                #7

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

                JonBJ 1 Reply Last reply
                0
                • GofferG Goffer

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

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #8

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

                  1 Reply Last reply
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved