System("Ping") always returns 0

J

Jerry Coffin

Sjouke Burry wrote:

[ ... ]
Why not redirect the ping output to a file,then read the
file to get your info?(Dont forget to delete the file)

There's no portable way to do I/O redirection either.

IOW, as has been pointed out a number of times already, doing this
requires platform-specific code, which indicates that it should be
discussed where the particular platform(s) in question are topical.
 
D

Default User

Jerry said:
Sjouke Burry wrote:

[ ... ]
Why not redirect the ping output to a file,then read the
file to get your info?(Dont forget to delete the file)

There's no portable way to do I/O redirection either.

It even depends on the particular implementation of ping sometimes, as
different versions can have differing output. When I did a task like
this many moons ago, the ping we had on our HPUX systems was different
from the one I'd previously used on Solaris, so I had to alter the
parsing routine (I used popen(), but that's irrelevant to this group).
IOW, as has been pointed out a number of times already, doing this
requires platform-specific code, which indicates that it should be
discussed where the particular platform(s) in question are topical.

Absolutely.



Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top