QFileSystemWatcher on a network mount
Hey all,
I have a network mounted home directory (on linux). I want to use QFileSystemWatcher on files in this network mount.
By default, QFileSystemWatcher uses inotify on linux (if supported by the kernel). However, inotify doesn't seem to work for files on a network mount.
Do any of you know of a workaround to get file system notifications for network mounts?
Thanks!
Re: QFileSystemWatcher on a network mount
The usual workaround for this is to use a timer and periodically check the last modified timestamp of a file.
Re: QFileSystemWatcher on a network mount
Yes, I get that. However, the Qt documentation for QFileSystemWatcher says:
"Note: On systems running a Linux kernel without inotify support, file systems that contain watched paths cannot be unmounted."
From which I deduce that Qt itself will fall back to polling if inotify isn't available. Now it would be nice if I could force QFileSystemWatcher to use polling, but that doesn't appear to be in the documentation :(
Re: QFileSystemWatcher on a network mount
I've been checking the sources and I think it may be possible to subclass qfilesystemwatcher and force it to use its polling watcher engine. Going to try that tomorrow, will post the results here of course :)
Re: QFileSystemWatcher on a network mount
Okay, subclassing QFileSystemWatcher is not going to work because the implementation is private (pimpl). Any suggestions other than creating my own polling class would be more than welcome, I'm a bit out of options now :(
Re: QFileSystemWatcher on a network mount
For anyone else having this problem, a "solution" can be found here: http://lists.trolltech.com/qt-intere...ad00553-0.html