Subject: | |
From: | |
Reply To: | Walter J. Murray |
Date: | Mon, 7 Jul 2008 21:20:36 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Mike asked:
> I am porting a C application over to MPE/iX and I have some questions
> regarding CREATEPROCESS. It seems CREATEPROCESS only lets me launch
an
> executable program. What do I need to use if I wanted to STREAM a job
or
> run an internal command such as a LISTFILE? Also, when using
> CREATEPROCESS,
> the executable in which I want to launch will only launch if the
> executable
> is in the same group as my application.
For an easy way to execute commands from a C program, try the system()
function. It calls HPCICOMMAND for you, and you don't have to append a
carriage-return.
You can even use it to execute a RUN command, so you might not need to
use CREATEPROCESS.
Here's a sample program.
-----cut here-----
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int return_value;
/* Invoke our favorite text editor */
return_value=system("RUN EDITOR.PUB.SYS");
if (!return_value)
{
puts("Everything is fine!");
return EXIT_SUCCESS;
}
else
{
puts("*** OOPS! ***");
return EXIT_FAILURE;
}
}
-----cut here-----
Walter
Walter J. Murray
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|