سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top