문제

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