Re: Function to execute a program
- From: John Cupitt <john cupitt ng-london org uk>
- To: Pisanu Prasertnopakun <p prasertnopakun web de>
- Cc: gtk-list gnome org
- Subject: Re: Function to execute a program
- Date: Tue, 28 Oct 2003 22:00:34 +0000
Hi,
Pisanu Prasertnopakun wrote:
// HERE i find a function to run a simple program like xclock!!
// i should ! be "run(xclock);" or something like that.. have somebody
an idea?
The easiest is system():
if( system( "xterm &" ) )
printf( "couldn't start xterm\n" );
It's *nix only. glib has g_spawn_*(), which will work on all platforms.
http://developer.gnome.org/doc/API/2.0/glib/glib-Spawning-Processes.html
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]