\pdffilesize and spaces

Karl Berry karl at freefriends.org
Fri Oct 18 23:26:24 CEST 2019


    \edef\test{\pdffilesize{file_1.tex }}\show\test
    \edef\test{\pdffilesize{"file_1.tex "}}\show\test

Fixes are welcome (sorry, I didn't see the reason in pdf_file_size_code:
and show_token_list offhand), but (I doubt any of the following is news
to you) ... I think there is no way to use \pdffilesize etc. on
arbitrary filenames. Maybe they can be made to work with one space, but
2+ consecutive spaces in the input will get transmuted into one by TeX's
scanner before the primitive over sees it, if I understand
correctly. Catcode 9 characters will likewise disappear, etc., etc.

And the quotes are a whole problem in themselves, since now you can't
find filenames containing quotes. For example,
\pdffilesize{"file_1.tex"} should arguably fail unless the filename has
quotes. (I am not sure where the quotes are read in this case.)

It's all so broken, and has been since day one.  Some difference between
Lua (which I suppose can get all this right, since it can, I assume, see
the actual input characters, not just the token stream) and the other
engines is probably inevitable. -k



More information about the tex-live mailing list