Is there any way to store the output of system calls in C?
I.e. piping the output of the Unix command system("ls") into a string which will be used later in the program.
The only method I can think of right now is system("ls>temp"), read contents of temp, system("rm temp -f"). If you have better suggestions, please give me some.
Gratitude for help.
I.e. piping the output of the Unix command system("ls") into a string which will be used later in the program.
The only method I can think of right now is system("ls>temp"), read contents of temp, system("rm temp -f"). If you have better suggestions, please give me some.
Gratitude for help.
