\newwrite\x
\immediate\openout\x = xfoo.out
\immediate\write\x{hello}
\immediate\closeout\x
\bye
