[luatex] writing to log/term

Arno Trautmann Arno.Trautmann at gmx.de
Sun Nov 20 10:53:09 CET 2011


Taco Hoekwater wrote:
> Better code:
>
> \let\n\relax
> \directlua{
> delay = 1.0
> texio.write_nl("first comment\n")
> os.sleep (delay)
> texio.write("second comment\n")
> os.sleep (delay)
> }

Thanks, I wanted to keep the code as OS-independent as possible, but I 
guess that's not necessary.

> That avoids the busy sleep, and it may help output responsiveness:
> texio.write_nl writes text to a new line, but does not actually append
> the next new line, so on a line-buffered output device, you see the
> first line only when the second line is being printed. On a block-
> buffered device that does not help, but usually terminals are not done
> that way.

Ok, now I understand what's going on. I have been testing in TeXworks, 
which seems to be block buffered. On my terminal, your code works as 
expected, thank you!

cheers
Arno


More information about the luatex mailing list