[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: The 'ex' library
- From: "Bob Hibberdine" <bob.hibberdine@...>
- Date: Fri, 20 Aug 2010 09:23:07 +0100
Hi all,
I have just started playing around with 'ex' library in Lua for Windows
and have hit a problem:
The following using standard Lua works as expected:
-- run the windows help command..
rd = io.popen("help", "r")
while true do
local r = rd:read()
if r == nil then break end
print(r)
end
print("read loop done")
But this using the ex library does not:
-- open a pipe
local rd, wr = assert(ex.pipe())
-- run "help"
local proc = assert(ex.spawn("help", {stdout=wr}))
wr:close()
while true do
local r = rd:read()
if r == nil then break end
print(r)
end
print("read loop done")
The output from "help" gets printed out but rd:read() hangs when there's
no more left to read (ie at EOF).
Have I got something wrong or is there a bug in ex....?
Thanks and regards
Bob
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________