Hi Arno, your code is okay (except for the busy waiting :) the output gets buffered by the next step (terminal, whatever program), so you need unbuffered output. I can't see how you can flush a buffer with LuaTeX. Patrick