I was following page 216 of Knuth, but cannot get the following code to run. The error message is:
! Emergency stop.
<read 1>
l.12 \read\fid to\temp
*** (cannot \read from terminal in nonstop modes)
I might mention that I cannot find \openin
in the log file at all.
\begin{filecontents}{address.txt}
test
\end{filecontents}
%
\documentclass{article}
\tracingmacros=1
\newread\fid
\begin{document}
\the\fid
\openin\fid={address.txt}
\read\fid to\temp
\closein\fid
\temp
\end{document}
plain
equivalent, it tries to read from the terminal, and whatever I type in the terminal ends up in the final output dvi file.)\openin
wrong:\openin\fid=address.txt %
with no braces. I also agree that this is quite confusing as-written (plain-tex is for things that only apply to plain: perhaps you mean tex-core?)\openin\fid=address.txt
works if you have a file namedaddress.txt
. With the brace it tries to read from the terminal, which is rather confusing.