The old environment (before 10/2019)
\usepackage{filecontents}
\begin{filecontents}{tabelle.tex}
... some text ...
\end{filecontents}`
will overwrite an existing file tabelle.tex.
After my update yesterday in debian sid, it does not work any more.
I removed the \usepackage{filecontents} because the functionality should now be inside the LaTeX kernel.
But filecontents will not overwrite my file (with respective message in log):
LaTeX Warning: File 'tabelle.tex' already exists on the system.
Not generating it from this source.
Trying to force overwrite with
\begin{filecontents}[overwrite]{tabelle.tex} leads to error:
! LaTeX Error: Trying to overwrite 'kivitendo-print7y2OSd.tex'.
So it looks like it tries to overwrite the encompassing file.
Is this a bug or am I missing a point?
Edited 09.11.2019:
Minimal example:
\documentclass{article}
\usepackage{etex}
\begin{filecontents}[overwrite]{addfile.tex}
\centering{Hello World!}
\end{filecontents}
\begin{document}
Just a test.
\end{document}
Apparantly, the \usepackage{etex} causes the error.
The latex code is used by the web application kivitendo.
Within my short test, I see no drawback to eliminate the package 'etex'.
After that, for me it's working.
Trying to overwrite ...was introduced in the new kernel when trying to write on\jobname.tex, so it should be the new version. OP probably has some code writing on\jobname.tex, for some reason. Impossible to tell without an example... – Phelype Oleinik Nov 01 '19 at 14:48\jobname.texexists. (This is not necessarily the case when calling latex with the-jobname=...-option. ;-) ) – Ulrich Diez Nov 02 '19 at 13:40\jobname.texdoes not exist. it should be safe to write on it. That's one of the problems we discussed when writing this implementation. There's no reliable way to test “am I trying to write on the current source?”, so the approach we agreed on was to test for\jobname.tex, which will be correct most of the time. Everywhere else, user's discretion is advised. – Phelype Oleinik Nov 02 '19 at 14:19\begin{filecontents}[overwrite]{notatabelle.tex}resulted inLaTeX Warning: Writing or overwriting file `./notatabelle.tex'.and a correctly overwritten filenotatabelle.tex. Can you show a full example document (and explain how you compile that document) that reproduces this weird behaviour? – moewe Nov 02 '19 at 14:21etexbugtracker: https://github.com/davidcarlisle/dpctex/issues/23, there is also some discussion about this in chat starting from https://chat.stackexchange.com/transcript/message/52492694#52492694 – moewe Nov 09 '19 at 17:33