Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. everyoneca

    how do I store stdout value from system(); into a char* variable?

    I may have found an example: #include <stdio.h> main() { FILE *fp; char line[130];/* line of data from unix command*/ fp = popen("ls -l", "r");/* Issue the command.*/ /* Read a line*/ while ( fgets( line, sizeof line, fp)) { printf("%s", line); } pclose(fp); } ----
  2. everyoneca

    how do I store stdout value from system(); into a char* variable?

    can you provide a short code example of popen(); storing the stdout value of "ls -la" or "netstat" into a char* type or string variable? thankyou for your help
  3. everyoneca

    how do I store stdout value from system(); into a char* variable?

    how do I store stdout value from system(); into a char* variable? e.g. I have child process that executes system(); function, but the output is displayed on server binary tty, I would like to store the output of system("ls -la"); into a char* variable for later use / display . is this...

Part and Inventory Search

Back
Top