1828189 Members
2338 Online
109975 Solutions
New Discussion

Invoking an executable.

 
Mustafa Motiwala
Occasional Advisor

Invoking an executable.

Well, this is basically covered in a programming topic, but, how does one execute another binary from a c code? like the system function in perl. how does one achieve the same on linux?
3 REPLIES 3
Balaji N
Honored Contributor

Re: Invoking an executable.

hi
i am not good at programming but there exists a system function in C as well to call an external binary/script.


regards
balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Mustafa Motiwala
Occasional Advisor

Re: Invoking an executable.

yes, and its execle() but the problem is that these functions dont return control to the calling prog. i need control back after the prog. ends.
Bjoern Myrland
Advisor

Re: Invoking an executable.

Hi

I'm no coder, but you have a system function in c as well, where you can call an external binary to be executed:

system("/path/to/executable_to_run");

This works when calling a shell script at least, and I'm able to return control to the c program after calling the shell script.

rgds Bjoern.