Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
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.
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
Bookmarks