[Omake] Case-insensitive filesystems

Nathaniel Gray n8gray at caltech.edu
Tue Dec 12 14:25:57 PST 2006


Jason Hickey wrote:
> 
> On Dec 12, 2006, at 1:01 PM, Aleksey Nogin wrote
>>
>> Jason, any ideas how we might fix the find-target-* functions to do 
>> the right thing on case-insensitive filesystems? Should we just add 
>> global variable that defaults to true on OS X and Windows, but can be 
>> overwritten by the user? Or is there some hope of being able to detect 
>> this?
> 
> Actually, I'm not sure why it is happening.  The result of "ocamldep 
> -modules" should be uncapitalized, so if we see a dependency on Foo, we 
> would check if foo.cmi is buildable.  Granted, without knowing 
> case-insensitivity, this would fail if the file were really fOo.ml.
> 
> For case-sensitivity detection, we could
>    - use statfs(2) to check for HFS, but this is unreliable, since HFS 
> can be forced case-sensitive (I believe)

Yes, there's a case-sensitive version of HFS+.  And lots of Mac users 
have FAT-formatted external drives.  And some Linux users probably have 
HFS/FAT partitions too.

Is it possible to have a case-sensitive fs on windows?  I know there's 
an ext2 driver out there...

>    - test whether, for example, .omakedb and .OMAKEDB are the same file

The second option seems best to me.  It's platform-independent and 
robust to any future filesystem changes that might occur.

> Project-wide detection will break if the project contains a mount point 
> where the case-sensitivity changes...  Unfortunately stat(2) is missing 
> this info on a file basis.  Perhaps a call to statfs(2) for each 
> directory in a project...

Ouch.  This strikes me as a case of "don't do that."

-- 
 >>>-- Nathaniel Gray -- Caltech Computer Science ------>
 >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->


More information about the Omake mailing list