Re: How to call system command



There is not enough info - how do you need to launch the command, from where ??
etc.. do you need the output?? do you need to read the output, do you want it
to block, etc..

1) you can use system("ipchains blah blah&");
2) you can fork a processes
3) you can use pipes :

FILE *pipe 
pipe = popen("ipchains blah blah","r");
that way you can read the output

Maher


On Sun, 22 Oct 2000 18:22:03 +0800, Terry Ha said:

> Hi,
>  
>  I want to write a GTK+ application that utilize the "IPCHAINS".  I want to know how to call system command, such as "ipchains -A input -d 192.168.1.1 -j DENY" and "clear".  Pls answer this question, because it is urgent.
>  
>  Thanks,
>  
>  Best Regards,
>  Terry Ha
>  

-- 
muhri muhri net -- http://www.muhri.net





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]