lualatex fails with permission denied when trying to input a file open for writing
MiKTeX source code moved to GitHub
Brought to you by:
csc
The following document crashes when compiled with lualatex.
The document is faulty, source of the problem is obviously that it tries to \input a file which is still open for writing. Adding \immediate\closeout\testwrite before the \input avoids the crash.
But neither pdflatex, nor xelatex nor the lualatex of texlive actually crash with this document So I'm reporting the issue in case, that it shows some underlying error in the miktex luatex (and to help people to track down errors in their document leading to permission denied error.)
\documentclass[]{article}
\begin{document}
blub
\newwrite\testwrite
\immediate\openout\testwrite \jobname.brf
\immediate\write\testwrite{abc}
\input{\jobname.brf}
\end{document}
The lualatex.log reports:
2015-10-24 17:04:32,798+0200 FATAL lualatex - Permission denied: ./test-utf8.brf
2015-10-24 17:04:32,798+0200 FATAL lualatex - Info: ./test-utf8.brf
2015-10-24 17:04:32,798+0200 FATAL lualatex - Source: Libraries\MiKTeX\Core\win\winFile.cpp
2015-10-24 17:04:32,798+0200 FATAL lualatex - Line: 704
I have fixed this and the bug will be resolved in a future (November) update of the MiKTeX binaries.
This has been fixed, i.e., the above test case now works.