[luatex] read and write streams

jfbu jfbu at free.fr
Thu Nov 19 18:48:53 CET 2015

Le 19/11/2015 14:45, David Carlisle a écrit :
> On 19 November 2015 at 13:21, jfbu <jfbu at free.fr> wrote:
>> will (or is) code using \immediate\write16{foo} be broken
>> by more output streams ?
>> [snip]
> Yes.
> In an earlier draft of this (that I referenced in the initial question
> in this thread)
> 16 was sort of reserved, but I think that's wrong, 16 isn't special in pdftex
> any non allocated stream writes to the terminal, I often used 20 for example
> (as going under 18 seemed wrong:-)  luatex can't reserve all numbers
> bigger than 15
> and extend the range, so something has to give...
> I think the current suggested model of allowing 0-127 to be used is fine.
> To be portable and use an unopened stream you can use any number
> bigger than 127 or use \@unused (which is 0 but you are not supposed
> to know that)  which is the allocated-but-unopened stream used by \typeout.
> So existing documents using \write16 or \write20 etc may need a small change but
> they will likely need small changes anyway given the number of changes
> to the luatex
> primitives.

Le 19/11/2015 14:32, Joseph Wright a écrit :
> Yes (which is where we started with this). With the new set up, the
> first 'certain to be unused' stream is 128. That should therefore be
> used instead of 16 where the 'dump to the terminal' behaviour is required.
> (Aside: At present stream 128 is not working with the W32 build I have,
> SVN 5538, but Hans confirms this is an out-and-out bug so will be solved.)
> Joseph

I used \write16 to write both to the terminal and the log file and I need
code suitable both for LaTeX and Plain, 

if I recall correctly \write-1 (which I presume will not be broken)
writes only to the log file

What is the recommended way for not necessarily LaTeX code 
(more precisely for code destined to be run either from Plain
or LaTeX)
to be
robust with respect to future enlargement of output streams for this task ?

(if the user decides to use LuaTeX)



More information about the luatex mailing list