QFileSystemWatcher problem

  • 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()

    We are on CentOS Gnome 2.28.2

    any idea ?


  • Qt Champions 2016

    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

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


  • Qt Champions 2016

    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)

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

  • Qt Champions 2016

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

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

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.