Dealing with case insensitivity

Jim Peters jim@uazu.net
Sat Mar 16 02:37:00 GMT 2002


Bryce McKinlay wrote:
> The basic problem is not that it parses extra files, but rather that
> it opens the same file twice under different names (which vary only
> by case). This results in an error about the same class being
> redefined in a different source file. It would be easy to fix, I
> think, if there was a way to tell if two files, opened by different
> names, are really the same.

Well, it seems to me that there *is* a way, and that is by reading the
directory instead of just opening the file. When you open the file,
case is ignored, but when you read the directory, you see the case as
the file was actually saved. An open on "image.java" would succeed,
but a manual search through the directory for that name would fail.
If every file-open read the directory first to see whether the file
actually existed with *exactly* the case as specified, then you would
only see each file once.
That is how I think it would work on Darwin, but on Windows you get
the extra complication of complete case-loss in 8.3 filenames, but at
least .java and .class files would show their correct case as these
don't fit in 8.3.
I know people seem to be thinking of a more clever way of solving
this, but mine is an outside-in solution from someone who is looking
for an answer but has no hope of pulling off anything clever.
I'll keep working on it.
Jim
-- 
 Jim Peters (_)/=\~/_(_) jim@uazu.net
 (_) /=\ ~/_ (_)
 Uazú (_) /=\ ~/_ (_) http://
 B'ham, UK (_) ____ /=\ ____ ~/_ ____ (_) uazu.net


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /