redirect into C++ without a file ?
I am quite new to linux, but I have been thinking about doing some gui-programming for some commandline-programs that has no gui (and could use it).
This is not the case but if I wanted to make a grafical ls program I could write something like
system("ls > result.temp")
... read from result.temp
... show gui with result.tmp
But I don't want to create a (temporary) and read from it ...
I could also try something like
system("mycommand --output | ls")
but that would just create a new process and I need someway to signal the output into the old process. (?)
And all I want to do is the simple thing like
char buffer [large]; (or maybe string)
system ( ls > buffer )
Am I overlooking a very simple solution here ?
Hope somebody will/can help me.