Error in using popen

hi

I'm using one popen function, via that i'm executing the unix commands. The Popen function is failling when it get called on 251 st time. Here is the code.

FILE *in=NULL;
in=popen("ls -l | wc -l", "r");
if(in == NULL)
{
cout<<" ERROR IN GETTING DIR LIST1 "<<endl;
exit(0) ;
}
else
cout<<"Success "<<endl;

can any one help me in this..
It sounds like you've run out of file handles.
i fixed the issue. i didnt close the opened IO's..
Topic archived. No new replies allowed.