[tex-live] behaviour of kpsewhich on case-insensitive mac system

Zdenek Wagner zdenek.wagner at gmail.com
Wed Sep 20 01:05:40 CEST 2017

2017-09-20 0:42 GMT+02:00 Karl Berry <karl at freefriends.org>:

> What I can imagine doing is first looking up the name as-is, and iff
> that fails, doing a case-insensitive lookup. Patches welcome, else I
> will put it on my ever-lengthening list. It essentially amounts to
> removing the compile-time configuration done now, and falling back to
> the case-insensitive test regardless of the system.
> It would be wrong to "randomly" return any case-insensitive match if an
> exact match exists.  That is, on Unix, \input FOO.TEX should prefer a
> file named "FOO.TEX" to "foo.tex".
> -k
> P.S. Explanation of the current behavior: Kpathsea was written at a time
> when in practice there was no such thing as an operating system which
> supported both case-insensitve and case-sensitive filesystems. (Also at
> a time when no one dreamed that a company would make such a disruptive
> and incompatible change to their systems, but never mind.)  Therefore
> the test was done at configure time.  In kpathsea/config.h there is:
> #if defined(OS2)     || \
>     defined(MSDOS)   || defined(__MSDOS__) || defined(DOS)    || \
>     defined(WIN32)   || defined(__WIN32__) || defined(_WIN32) || \
>     defined(DJGPP)   || defined(__DJGPP__) || \
>     defined(MINGW32) || defined(__MINGW32__)
> #define DOSISH
> #endif
> which is ultimately what determines whether case-sensitive or
> -insensitive test is done.
> (Zdenek, why this does not match on your OS/2 system, I can't say.)

HPFS on OS/2 is case retensive but case insensitive. If I create
SomeFile.tex, the file system will remember the case but it will match
somefile.tex and all other case alternatives. However, kpsea is compiled in
such a way that ls-R stores the names as they are listed by the file
system, i.e. it will store SomeFile.tex. If a TEXMF tree is configured to
search in the ls-R only, it will only match SomeFile.tex but not the other
variants. I no longer have OS/2 so I cannot run further tests.

However, the situation with case sensitivity is much more complex. OS/2 has
a limited support for ext2 which is case sensitive. The configuration file
for the driver allows switching case sensitivity on and off. The driver can
read files accessed via symlinks but is unable to create them.

Users of all OSes can use files via network which brings another mess. I
know some universities which provide one network installatin of TeX Live
supporting all platforms and the users hust mount the root of the tree and
set PATH. Thus Windows users invoke TeX Live from a case sensitive file
system although their disks are case insensitive.

And there is another big problem. In our institute we have Synology for
backup and sharing files. Since the majority of our users are on Windows,
Synology is configured to use Samba. The Samba protocol is case insensitive
although the underlying file system in Synology is case sensitive. It is
also possible to use WebDAV, sshfs, etc. Thus it depends how I mount
Synology on my Linux machine, if I mount it via Samba, I have case
insensitive system. If the directory has files with names differing only in
case and I try to overwrite one of them via Samba, I lose all the remaining
files. If I do the same action via sshfs or WebDAV, it works correctly as
it should on a case sensitive system.

So the right solution how to cope with case (in)sensitivity will definitely
be difficult.

Zdeněk Wagner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-live/attachments/20170920/c92fdd65/attachment-0001.html>

More information about the tex-live mailing list