Patch for Preview: jcf-io.c and Win32 case-insensitive filename handling

Mohan Embar gnustuff@thisiscool.com
Wed Mar 12 14:09:00 GMT 2003


Hi Ranjit,

>I might be wrong, but AFAIK, the proper way to do this is to define 
>it as a host file system macro....

>Perhaps this should really go in libiberty and specified as an 
>"extra" object for windows (see "libiberty/config/mh-windows")....

I've only been at this for about a month and the enormity of what
you're suggesting paralyzes me. (Just like when Andrew first said
I should mess around in natRuntime.cc and posix.cc.)

What's more:

- My code is specific to the open() call. If we did what you are
saying, we'd really need a CHECK_EXACT_CASE which was a no-op
on non-Win32, because the caller could want to do a subsequent open,
or an fopen, or who-knows-what.

- I have a hard time imagining the utility of this for anything other
than its intended purpose. Since Win32 is case-insensitive, requests
to open a file in a case-insensitive manner should be honored in all
but fringe cases like this.

>AFAICT, Cygwin will also have to define this, but in a different
>way from MinGW because it has a strict_case on/off runtime 
>setting. (What about MacOS X, where UFS seems to care about
>case but HFS+ does not? See
>http://developer.apple.com/macosx/win32porting/)

I was initially tempted to handle the Cygwin piece too, but I
figured that they already have a workaround and the extra effort
to determine the right way to do it for them would have made
me procrastinate on this indefinitely. In the end, I opted to
leave a framework in place that makes it trivial for anyone
to add themselves to the case insensitive gang (add an entry
in jcf.h, add a jcf-<os>.c file, add the file to Make-lang.in).
I also figured that the Darwin folks would jump on the bandwagon
if this ever got accepted.

>In jcf-win32.c, you should FindClose(hFile) *after* you have
>determined that hFile is not an INVALID_HANDLE_VALUE.

I *KNEW* you would catch this even as I was sending it, even
though the call is innocuous and we ignore any return code.
(I threw this code around one time too many and didn't want
to deal with it anymore.) You're right, Mom. Since I'm sure that
this is going to be further, er, "critiqued" based on your foo (bar)
and other remarks, I'll wait a bit for more feedback before resubmitting
this.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/






More information about the Java-patches mailing list