dear fs11
If u wanna run a binary then u can also use execl() call.
for example ur binary name is sample.bin and it is located in /root/sample.bin then write ur program as following,
int main(int argc, char **argv)
{
int t=0;
t=execl("/root/sample.bin","/root/sample.bin",(char*)0);
if(t==-1){
perror("EXECL FAILED");
}
return 0;
}
If u want to run ur binary sepratly from ur program use fork() sys call.
cheers !!!!!
Last edited by vdx; 09-08-2007 at 03:26 AM.
|