Le 29/04/2016 00:42, Karl Berry a écrit : > <>| are not valid in filenames > > They are on Unix. -k
Ooops... After some search on the Web I found this interesting discussion: http://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names In comment #33 somebody says that under *nix the only forbidden character in a file path is NUL (aka \0), and / cannot be used in filenames, only as a file separator in paths. So, this ruins my suggestion to catcode group locally special TeX characters, as there may be some people (or SW) using <>| in filenames under *nix for some special file that needs a crazy name to avoid collision with other names. However, instead of <>| I could use \bgroup for group beginning \egroup for group end nul for space. Note, that implicitely I assumed that \ will never be used in a filename, even under *nix for portability reasons to MSW. Another method for handling special characters in filenames would be to prefix all of them by \string (so this would even support filenames containing \ as part of the filename). My tex distribution expands all the macros in the filename before using it, so that would be valid to do simply that for handling ~ and suchlikes (just some piping the name through sed -e 's!\([#~\{}_^$]\)!\\string\1!g' ). However, I don't know whether this behaviour is widely used. Also, it does not help with space to replace them by `\space ', or by `\expandtafter\string\space ' to get some litteral space (space with catcode 11). I have already tried that. The \input command is really difficult in this that it does not work like other macros as far as grabbing the argument is concerned. It seems that LaTeX has redefined \input to support usual {...} enclosing (under TeX if you use {...}, tex will consider the curly braces as part of the filename). It would be interesting to test whether the LaTeX \input allows spaces in filenames, and if yes, how did they manage to do that. As a side comment, not related to texi2dvi, it would be good to document handling of special characters in filenames under LaTeX in latexrefman manual. Vincent.
