From 82a9d3d7e785ad838f8c6d0e5d779947be0c359f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 26 Nov 2012 13:31:00 +0100 Subject: beta 2012.11.26 13:31 --- tex/context/base/l-io.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tex/context/base/l-io.lua') diff --git a/tex/context/base/l-io.lua b/tex/context/base/l-io.lua index 3456001b7..ec628b5e0 100644 --- a/tex/context/base/l-io.lua +++ b/tex/context/base/l-io.lua @@ -336,3 +336,21 @@ end if not io.i_limiter then function io.i_limiter() end end -- dummy so we can test safely if not io.o_limiter then function io.o_limiter() end end -- dummy so we can test safely + +-- This works quite ok: +-- +-- function io.piped(command,writer) +-- local pipe = io.popen(command) +-- -- for line in pipe:lines() do +-- -- print(line) +-- -- end +-- while true do +-- local line = pipe:read(1) +-- if not line then +-- break +-- elseif line ~= "\n" then +-- writer(line) +-- end +-- end +-- return pipe:close() -- ok, status, (error)code +-- end -- cgit v1.2.3