![]() |
| | #1 |
| Registered User Join Date: Oct 2001
Posts: 2
| System Commands Output system("ls -al > /tmp/lsfile.txt"); Rather than saving it in file is it possible to save it in some string variable or any other data structure?Does any on know? |
| nasir_qau is offline | |
| | #2 |
| Guest
Posts: n/a
| There probly is, but if you want a temporary solution just load the file. |
|
| | #3 |
| Registered User Join Date: Sep 2001
Posts: 132
| Yes there is. try this: Code: FILE *fp;
fp=popen("ls -al", "r");
/* read from "fp" using f***-functions */
pclose(fp);
|
| alex is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| System commands | Tropicalia | C++ Programming | 3 | 09-30-2006 11:18 AM |
| retrieve output from system() | mmongoose | C++ Programming | 5 | 12-15-2005 06:44 AM |
| system commands. deletion of file after program terminates | xddxogm3 | C++ Programming | 12 | 11-24-2003 10:41 PM |
| string variables and system commands part 2 | Unregistered | A Brief History of Cprogramming.com | 1 | 10-25-2001 12:57 AM |
| string variables in system commands | Unregistered | A Brief History of Cprogramming.com | 3 | 10-24-2001 12:36 PM |