How do I find out if a program is running in "C" (this is linux)
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

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

Threaded View

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

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

    In bash I can find out if a program is running and do stuff if it is running or not running

    the code in bash

    Code:
    if [ `pstree | grep -o "progname" | head -n 1` = "progname" ]; then
    
    echo "program is running"
    
    else
    
    echo "program is not running"
    
    fi
    How do I do the same thing in "C"

    Thanks
    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center