CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #3
    Join Date
    Oct 2012
    Location
    New Zealand
    Posts
    11

    Cool Re: How do I find out if a program is running in "C" (this is linux)

    you mean something like:

    Code:
    if (system("pstree | grep -o "progname" | head -n 1") == "progname"); {
    
    /* program is running */
    
    /* do something here if program is running */
    
    
    } else {
    
    /* program is not running */
    
    /* do something here if program is not running */
    
    }

    for some reason I could not get the above code to work.
    Last edited by n_techo; October 12th, 2012 at 01:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured