Results 1 to 2 of 2

Thread: how to get the result of ping without displaying the ping operation in terminal

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question how to get the result of ping without displaying the ping operation in terminal

    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 .....

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to get the result of ping without displaying the ping operation in terminal

    i) shell redirection: system("ping ... > /dev/null") // linux
    ii) use QProcess

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.