[luatex] read and write streams

David Carlisle d.p.carlisle at gmail.com
Thu Nov 19 14:45:50 CET 2015


On 19 November 2015 at 13:21, jfbu <jfbu at free.fr> wrote:
> Hi David and Hans,
>
> one question of a neophyte
>
> will (or is) code using \immediate\write16{foo} be broken
> by more output streams ?
>
> (by this I mean could 16 end up being assigned to some
> file output stream number)
>
> best
>
> Jean-François
>
>

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.

David



More information about the luatex mailing list