[tex-live] No room for a new \write

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Sat Mar 17 09:42:45 CET 2007

Reinhard Kotucha <reinhard.kotucha at web.de> wrote:

> A limit of 32 files which can be open at the same time sounds
> ridiculously nowadays.  Yes, TeX (the program) allows you to have 16
> read and 16 write streams open at the same time.  But the plain TeX
> macros (which are used by LaTeX too) are extremely inefficient.
>
> Register allocation is currently stack based.  If you say
> \newwrite\foo, then \foo is is associated with \write0.  If you then
> say \newwrite\bar, \bar is is associated with \write1, and so on.
>
> The stack pointer is increased whenever you say \newwrite but nothing
> useful happens if you say \closeout.
>
> The alternative would be to make file allocation list based.

peter wilson's newfile package does just that.

of course, it only works (as david k has pointed out) if users use its
mechanisms exclusively, rather than trying to be "clever".

r