How to use PtSpawn

Hello.

I’m attempting to use PtSpawn() to run one Photon application from
another. I’m a little confused about the syntax of PtSpawn as described
in the library reference. I’m just looking to use PtSpawn in the most
basic way: I want it to execute another program and store the process id
into a pid_t variable. Can someone give me an example of PtSpawn used
in such a way?

I’ve tried a few times already, using NULL for the arguments aside from
the command argument. The program compiles fine, but I get memory
errors when Photon reaches PtSpawn.

Any help is most appreciated.

Thanks,

Mike Sherman
Department of Neurobiology and Physiology
Northwestern University
Evanston IL, 60201

Hi Mike,

Here’s some really basic code that works:

pid_t ThePid;
const char *spawn_args[]={ “/qnx4/photon/bin/pv”, “pv”, NULL };
ThePid = PtSpawn( spawn_args[1], spawn_args, NULL, NULL, NULL, NULL, NULL );

Regards,
Rich



Mike Sherman <m-sherman@northwestern.edu> wrote:

Hello.

I’m attempting to use PtSpawn() to run one Photon application from
another. I’m a little confused about the syntax of PtSpawn as described
in the library reference. I’m just looking to use PtSpawn in the most
basic way: I want it to execute another program and store the process id
into a pid_t variable. Can someone give me an example of PtSpawn used
in such a way?

I’ve tried a few times already, using NULL for the arguments aside from
the command argument. The program compiles fine, but I get memory
errors when Photon reaches PtSpawn.

Any help is most appreciated.

Thanks,

Mike Sherman
Department of Neurobiology and Physiology
Northwestern University
Evanston IL, 60201