lua-users home
lua-l archive

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


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 
______________________________________________________________________