Return value of program invoked with system()
Posted on 2003-11-04
I'm writing a program that listens for network connections on a certain port.
Every X minutes it has to run a certain program (a program that I have written myself).
I do not wish to use cron or anything like it.
I invoke the program with the "system()" function and it works.
The only thing that annoys me is that I can't get hold of the return value of my program.
If I write this in my second program:
I want to use the return value for status purposes, how do I do this?
I want to be able to write something like this in my server program:
//INVOKE PROGRAM HERE
Is this possible with the system() command?
If not, what should I use?
Thanks in advance,