/usr/local/texlive/2024/texmf-dist/tex/latex/tools/.tex .tex is special-cased in the kpse code precisely because LaTeX provides/requires it. .. (line 1280 of kpathsea/tex-file.c) && !STREQ (q, ".tex") /* specially allow .tex */ So it's necessary to do any (TeX) testing with a different .filename. -k