GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 12:29 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: usage of system() statement
PostPosted: Wed Oct 24, 2007 11:20 am 
Offline
Familiar Face

Joined: Tue Oct 09, 2007 5:07 am
Posts: 8
hi all,
i have one doubt regarding system() statement..........

i have one statement like "system("ggcov itemfactory.c");"
i have put it in one callback function and i called it...it is working for this itemfactory.c program...

Now i would like to know about is there any way to put the program name dynamically...i mean when i call this function it will execute the program itemfactory.c.... but is there any way to put our program name instaed of itemfactory.c by storing this program name in some variable.....

Thanks in advance...
Regards,
RajasekharReddy.b


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 24, 2007 1:34 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
You could use something like g_strdup_printf () to build you command based on whatever your needs...

Code:
gchar *options;
gchar *command;
gchar *filename
gchar *command_string;

/* some code to assign above variables */

command_string = g_strdup_printf ("%s %s %s", command, options, filename);

system (command_string);

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 8:30 am 
Offline
Familiar Face

Joined: Tue Oct 09, 2007 5:07 am
Posts: 8
Thanks for giving me the valuable information...
it is working fine for me....
oonce again thanks...
Regards,
RajasekharReddy.B


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], grijalvaromero, Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group