popen output 2005-03-10 - By Muhammad Rizwan
Back
Hello
Is it possible to read the results of popen from stdout i.e. console
through c program. I am using the follwoing program, and its showing the
result of command on console, but this output is not readable by
program.
fp = popen( "useradd testing ", "r ");
while( fp != NULL )
{
memset(Buffer, '\0 ', sizeof(Buffer));
CharRead = fread(Buffer, sizeof(char), 1023, fp);
if( CharRead > 0 )
{
cout < < "Buffer: " < <Buffer < <endl;
}
else
break;
}
Any idea?
Thanks
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
|
|