Question

I have a Qt 5 C++ app which runs great monitoring a local file, using QFileSystemWatcher. I'm now trying to watch a file on another host, mounted via nfs. While my app can open and read the file, it is not getting signals for file changes.

Is it possible to use QFileSystemWatcher to achieve this? If not, is there a way to mirror the remote file onto the local file system, and then watch that file?

Était-ce utile?

La solution

On Linux, QFileSystemWatcher is implemented with inotify, as explained in this blog entry: http://blog.rburchell.com/2012/01/qfilesystemwatcher-internals-in-qt-5.html

By default inotify can't work with nfs. Look at this answer for more information, and a possible workaround: inotify with NFS

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top