On Fri, Jul 28, 2023 at 07:53:19PM +0100, David Carlisle wrote: > On 28/07/2023 18:57, LARONDE Thierry wrote: > > but if \filesize{README} and \mdfivesum{README} refer to a different > file than \input{README} then they are not reliably useful for their > main use cases. It shall be noted that as long as a filename is subject to different behavior (adding an extension or not; I'm unclear now about the fact that \input could try to input README without the ".tex" extension if not found, deviating from m.537---and even \openin is adding inconditionnally a ".tex" if no extension: see m.1275). But at the LaTeX (macro) level (but even at the binary level: no atomicity; but the time gap is increased at macro level), if the behavior is not definite, you have a race condition. The first \filesize{README} could first fail to read a README.tex then succeed to read a README (without extension) but the \input following, because something in the system has created a README.tex in the meantime, would be opening _not the same file_. So the behavior has to be definite and the filename fixed or there should be the mean to store the absolute pathname of the file found first and to use only this pathname without beating around the bush anymore for any other use or, as is done in code, to open it (without filling the buffer at first and not close it) and to refer to this handle further in the code. Or there is a consistency/security problem. The first and not totally satisfactory solution is to impose an extension (".tex" being added if no extension to the name) without alternatives. But this ensures only the filename, not that another request will not find another file with the same filename earlier in the path when searching... So: 1) Is LaTeX expecting to be able to "\input" a file without extension? For me, "\input" could only be a tex file; so the extension was mandatory... 2) What is done to ensure that the same file, at least by its absolute pathname, is opened when opening it several times? -- Thierry Laronde <tlaronde +AT+ polynum +dot+ com> http://www.kergis.com/ http://kertex.kergis.com/ Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C