Dealing with case insensitivity

Jim Peters jim@uazu.net
Fri Mar 15 01:06:00 GMT 2002


Bryce McKinlay wrote:
> I wonder if anyone has any ideas on what is the best way to change jc1
> so that it can tolerate case insensitive file systems.

I know this is a *very* old thread, but I have an idea.  On Darwin at
least, the case is correctly stored in the filesystem.  However,
opening a file is a case-insensitive operation.

That means that the problem could be worked around by doing a
directory listing to check that the case is what we hoped it was.
This overhead would only need to be turned on for certain filesystems.
(Also, the directory listings could be cached).

On Windows, case is also stored, but only for names that don't fit in
8.3.  All the .java and .class filenames don't fit in 8.3, so those
are fine.  However, short directory names might become uppercased, in
which case there could be an extra rule for Windows-hosted filesystems
that says "if it is a directory, then it must be lower case".  If our
mixed-case name matches a directory-name in the filesystem, then it is
a bad match.  This assumes the Java convention of having lowercase for
all the parts of the path before the classname.

Maybe this extra rule for Windows isn't really necessary, but it is
the only extra 'gotcha' I can think of.

At the moment, I'm still getting a handle on the cross-build process,
so I'm sorry I can't test this yet or submit patches.  (My interest is
in a MinGW-hosted GCJ).

I hope this is of use --

Jim

-- 
 Jim Peters                  (_)/=\~/_(_)                 jim@uazu.net
                          (_)  /=\  ~/_  (_)
 Uazú                  (_)    /=\    ~/_    (_)                http://
 B'ham, UK          (_) ____ /=\ ____ ~/_ ____ (_)            uazu.net



More information about the Java mailing list