Uncertain Flush Timing of Buffered \write Commands in TeX
Problem Context When a TeX document issues \write commands before the corresponding \openout for the same file number, the write data is stored in an internal buffer. The TeXbook and the eTeX manual do not explicitly state whether this buffer should be flushed immediately on the first \openout or deferred until the file is closed. Different engines (pdfTeX,