[Ilugc] system commands from Gtk

2010-06-14 Thread Prabhu Gnana Sundar
I have used the system( ) command to execute the system commands through the 
Gtk program... Please suggest me whether I can adhere to this or it's better to 
use the execv function... I am learning through the Gtk...pls suggest.

Regards,
Prabhu Gnana Sundar.



___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] system commands from Gtk

2010-06-14 Thread Satish Eerpini
> I have used the system( ) command to execute the system commands through the 
> Gtk program... Please suggest me whether I can adhere to this or it's better 
> to use the execv function... I am learning through the Gtk...pls suggest.

you really did not mention what you are trying to do in the so called
gtk programs. Anyway as a short description,

system() : allows you to run a binary from inside a C program, but you
don't have any control on the executing program, you just have to wait
until the call to system returns

there are other interfaces you can use though :

popen() : is very similar to system, but it also allows you to either
pipe input to the stdin of the binary you are executing, or pipe the
stdout of the binary you are executing and access it via a file
descriptor in the C program. You can only do one at a time and the
program waits for popen() to return.

the exec family of functions : allow you to run a binary executable
and you can control the process since when you run it a new process is
forked and you have control over the child.

may be a little more info on what you are trying to do will allow you
to decide better.

Cheers
Satish


-- 
http://satisheerpini.net
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc