Re: Problem with popen



On Oct 15, 7:39 am, h...@xxxxxxxxxxxxxxx wrote:
I'm having a problem with popen which is quite hard to explain. The
beavior I'm seeing looks fairly random but must be related to a
resource leak of some kind.

What I'm seeing is that after 20 minutes run when everything is done
and everything has settled then popen doesn't work anymore. When I
start up another "tcp statistics client" using the same method of
popen, fread and pclose then popen just opens the process, fread
returns NULL and pclose returns without error.

As a first step, you might try checking feof() and ferror() when
fread() fails, and if ferror() is true, call perror() to get the error
code. This may help diagnose the problem.

Otherwise, it would be helpful if you could post complete code that
can be compiled and run. Then we can see if we have the same results
you do.

.