Mehrere PID Prüfen
-
Hi Brauch hilfe
ich brauche code
wo mehrere PID Prüft ob die schön gestartet sind (ohne Start)wie bei z.B Bash
if pidof firefox || openbox; thenDanke vorraus !!
@val78
pidofLinux call: https://linux.die.net/man/8/pidof
https://stackoverflow.com/a/36875505
https://stackoverflow.com/a/37721865
https://stackoverflow.com/a/43796871etc.
You would run the
pidofvia Qt'sQProcess, and read back its output viaQProcess::...read..., e.g. https://stackoverflow.com/a/17344946.Ultimately solutions read & parse what's going on below the
/procpseudo-file system, if you want to do that yourself --- Qt will not have its own function for that. -
ich habe jetz so
QProcess process; QString pgm("pgrep"); QStringList args = QStringList() << "firefox"; process.start(pgm, args); process.waitForReadyRead(); if(!process.readAllStandardOutput().isEmpty()) qDebug()<<"TRUE"; else qDebug()<<"False";wie krieg ich jetz noch "oder" um mehrere PIDs gleichzeitig prüfen'?