On 02/03/2011 09:38 PM, mathew wrote:
> On Sun, Jan 30, 2011 at 23:07, Jeremy Bopp <jeremy / bopp.net> wrote:
>> On 01/30/2011 06:30 PM, mathew wrote:
>>> On Sat, Jan 29, 2011 at 11:49, Jeremy Bopp <jeremy / bopp.net> wrote:
>>>> Where possible, Ruby scripts should see *Ruby* as the platform, not
>>>> Linux, not OSX, and not Windows.
>>>
>>> If that's true, are Ruby filenames case-sensitive or not? And are they
>>> case-preserving or not?
>>
>> The handling of file names is dependent on the underlying filesystem.
>> That means that file names are case-insensitive and case-preserving by
>> default on FAT and NTFS (used by Windows) and on HFSX (used by default
>> for OSX, I think).
> 
> So if "it depends on the OS and filesystem" is the right answer for
> case sensitivity, why isn't it the right answer for how file globs
> work?

Globs aren't implemented by the OS or the filesystem.  They're
implemented by applications that run upon them.  Ruby has one
implementation of globbing, and cmd has another one.

Ruby can't do anything about the filesystem implementation.  There is no
way to completely hide the differences between case-sensitive and
case-insensitive filesystems.  As a result, you as a programmer are
forced to be aware of those potential issues if you want to write a
cross platform application no matter what tools you use.

-Jeremy