[luatex] Printing to the console

Will Robertson wspr81 at gmail.com
Thu Jun 3 06:36:05 CEST 2010


On 2010-06-02 20:38:37 +0930, Taco Hoekwater 
<taco at elvenkind.com> said:

> Will Robertson wrote:
>> 
>> Is there any way to "flush" the console buffer before the
>> very-slow-operation begins?
> 
> No, but you can split your print statements: use the
> 'standard' lua function io.write(..) for the console
> and texio.write_nl('log', ...) for the log file.


Sorry, Taco, I don't follow. You can use texio.write_nl('term', ...) to 
split them up anyway, right? I want both statements set to the console, 
I just want the first one to arrive *before* the big wait while the 
font cache is being built.

The closest I've managed to achieve this with some sort of manual 
effect (albeit totally unuseable) is

\directlua{ io.write("start") }
\def\1{^^J WAIT!}
\def\2{\1\1\1\1\1\1\1\1\1\1\1}
\def\3{\2\2\2\2\2\2\2\2\2\2\2}
\def\4{\3\3\3\3\3\3\3\3\3\3}
\typeout{\4\4 HERE:}

which sends enough data to the console that it prints it all before the 
long operation occurs.

Is it technically feasible to imagine a command like 
"texio.write_flush" that sends its output to the terminal *immediately*?

Will




More information about the luatex mailing list