QFileSystemWatcher not working with /etc/mtab
-
loladiro: I read that page before, but I didn't quite understood what was going on...
peppe: I don't know what would be to return to the event loop, but my guess is that my code is correct, otherwise it wouldn't work with files inside /home directory right?
@watcher = new QFileSystemWatcher(QStringList() << "/etc/mtab",this);
connect(watcher, SIGNAL(fileChanged(const QString &)), this, SLOT(getPathFromFile(const QString &)));@If I change "/etc/mtab" to say a file in my home folder, the fileChanged signal is emitted, but not for "etc/mtab" file :(
-
The patch to Qt Mobility I linked basically changes the QFilesSystemWatcher and uses its inotify backend for linux. I think it is pretty straight forward what is going on, and since it does exactly what you want (listening for new devices), it might be worth it for you to see what's going on and how they replaced the old QFileSystemWatcher syntax (in red) with inotify (in green).
-
Hi TheQtGuy
i don't have any efficient solution but offer some idea:-
Run Qt Creator as root :)
@sudo -b qtcreator@ -
your real-time access problem is with Dir o File? check it !
say more about ur prob. and share ur experience dear ;)
-
-
excuse me friend because of my low english writing ability
i think that you want check your USB devices, and for doing it, you watch a file usign filewatcher that OS change it when a new usb connect or disconnect, but your watch doesn't work and does not determine any change in file.
now you want understand why this problem occured? YES?