lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Jul 28, 2004 at 12:33:58AM +0300, Asko Kauppi wrote:
> 
> It seems 'popen' is only read, or write, but not both.
> What I'm trying to do is like:
> 
> 	echo blahblahblah | osascript | (catch output)
> 
> That is, Lua would be both feeding in _and_ reading the output of the 
> 'osascript' command (which runs AppleScript on OS X).

It's a limitation of the underlying popen() call. To do a
bidirectional pipe, you'll need to write a C function using pipe(),
fork(), dup2(), and execvp(). Then submit the result to lhf for
inclusion into lposix?

-- Jamie Webb