Re: Function to execute a program



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]