PDA

View Full Version : how to get the result of ping without displaying the ping operation in terminal



wagmare
13th November 2008, 10:41
hi friends/experts;
I got struck in a system call system("ping -W 0.5 -c 1 192.1.. . .. .") where the
system call return 0 on receiving response and else on unreached ...
my problem is that how can i make that system call not to be displayed on terminal because it obscuring the dialog that to be open next also it take lot of time if the host unreached
i use QProcess() and it works as it wont display the ping transmit in terminal but ccan get the result value ( 0->host reached else->unreached) QProcess() giving different value ,also i dont have to create new files to transfer the output ....
how can i do that ... how can i just get the system call value without running it... is there any way in Qt...
please help me .....

caduel
13th November 2008, 10:46
i) shell redirection: system("ping ... > /dev/null") // linux
ii) use QProcess