Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. Mehrere PID Prüfen
Forum Updated to NodeBB v4.3 + New Features

Mehrere PID Prüfen

Scheduled Pinned Locked Moved Solved German
3 Posts 2 Posters 899 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    val78
    wrote on last edited by
    #1

    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;  then 
    

    Danke vorraus !!

    JonBJ 1 Reply Last reply
    0
    • V val78

      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;  then 
      

      Danke vorraus !!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @val78
      pidof Linux call: https://linux.die.net/man/8/pidof
      https://stackoverflow.com/a/36875505
      https://stackoverflow.com/a/37721865
      https://stackoverflow.com/a/43796871

      etc.

      You would run the pidof via Qt's QProcess, and read back its output via QProcess::...read..., e.g. https://stackoverflow.com/a/17344946.

      Ultimately solutions read & parse what's going on below the /proc pseudo-file system, if you want to do that yourself --- Qt will not have its own function for that.

      1 Reply Last reply
      1
      • V Offline
        V Offline
        val78
        wrote on last edited by
        #3

        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'?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved