Catching stdin

For the Compleat Fan
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Catching stdin

Post 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..
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post 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

Locked