is it possible wit Qt Qprocess to detect if a mounted Loacation(maybe NAS) is connected? Generally i would check in /proc/mounts if there is an entry, but if i disconnect to the NAS the file doesn't realizes it. with the df command i can check if a mountpoint is available. But if the connection is disconnected the df process doesn't gives an output. Maybe infinite.
I tried it with
QProcess p;
p.start("bash", QStringList() << "-c" <<
"df -P -T /media/storage/ | grep QIS | awk -F ' ' '{print $1}'");
if (p.waitForFinished(2))
{
qDebug() << "Nothing";
p.close();
}
But nothing happens.
It seems that my program "freezes" when i try to df to a directory which ist'n mounted. Is it possible to cancel the process if there is no answer from the df process after, for example, 2 seconds?