[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bidirectional io.open()...anyone got one?
- From: "Mark Edgar" <medgar123+lua-l@...>
- Date: Thu, 5 Jul 2007 16:07:06 -0700
On 7/5/07, Duck <duck@roaming.ath.cx> wrote:
...but does anyone have either a patch or a package which implements a
bidirectional popen()? One which allows not just "r" xor "w" like the
standard version, but also "rw" so that I can use the file handle it
returns to push data into and get data out of the stdin/stdout of the
subprocess?
Oh, and which is portable between at least Linux and Windows, if not also
OS X and the BSDs?
Once again, I must plug the "ex" API at
http://lua-users.org/wiki/ExtensionProposal .
Please have a look at the popen2() example on that page. It's
implemented with io.pipe() and os.spawn(), both of which are provided
by Lua installations which provide the "ex" API.
The source code to the reference implementation is available on the
wiki, but an updated version will be available at
http://luaforget.net/projects/lua-ex as soon as the friendly luaforge
admins respond to my repository upload request ... ;)
-Mark