Page 1 of 1

Catching stdin

Posted: Fri Jul 23, 2004 12:39 pm
by newdep
Hello Lutz,

I would like to be able to catch the stdin data coming from a (exec) action..

Currently the (exec "programm" "command") works fine but im unable to
get a newlisp to catch the stdin data..

Is it perhpas an enhancement to enhance the "exec" command with stdin.

Because -->

(exec "ls") ; stores all stdin inside a string list

(exec "programm" "command" ) ; return stdin but newlisp is unable to catch it.


can you enhance "exec" like ??? ->

(exec "programm" stdout stdin )


Regards, Norman..

Posted: Fri Jul 23, 2004 4:44 pm
by Lutz
That is what I wanted to do originally. It turns out that on most Unix's the popen() call is still only unidirectional: popen(command, "r") or popen(command, "w"). Some OS can do popen(command "r+") for read/write on the same pipe, but most can't. But I will give it another look.

Lutz