[fpc-pascal] FPC with case insensitive file system under Linux

Noah Silva shiruba at galapagossoftware.com
Tue Feb 28 08:38:19 CET 2012


Hi,

2012/2/25 Graeme Geldenhuys <graemeg.lists at gmail.com>

> On 24 February 2012 16:13, Henry Vermaak wrote:
> >
> > Because case sensitive systems don't create as much confusion....
> Then lets look at it from an average user's point of view. Must they
> really be confronted with multiple files in a single folder named:
>
>   test.txt
>   Test.txt
>   Test.Txt
>   TEST.TXT
>   test.TXT
>   ....
>
> All the user wants to do, is open a "test dot t x t" file. Under Linux
> they could be confronted with multiple versions? Very confusing.
>
> I like to CamelCase my file names - it makes them easier to read in a
> file listing. But when I reference them in say a search dialog, I'll
> probably type them in all lowercase for speed reason. I would still
> like Linux to find that file though - but it wouldn't.
>
>
However, most users just click on the file.  And most users who would type
the filename know enough to type the proper case.  (And the GUI file
selector could search-as-you-type, in a case sensitive or insensitive way).


> As I, and it seems many others on the Internet, have found - there
> really isn't a good reason why Linux must still use case sensitive
> file systems.


Probably the main reason is because C does.  Also, while users don't care,
tech people tend to prefer definite accuracy over possible ease.  However,
while I am strongly for case insensitivity in programming languages (It's
too easy to have different cases in different parts of the code), I don't
think many people would have a huge preference in file systems.  Unlike C,
where many programmers make use of the case sensitivity, I don't see
otherwise duplicate files often in Linux (someone correct me if you have a
good example).  Yet very few have complained (in a valid way) about the way
Linux does it, so it's unlikely to change any time soon.  Also, as
mentioned before, to do things *properly* for case insensitivity with
non-ASCII would require a very large amounts of code.  This is the same
reason why SQLite doesn't even try.


> Windows supports multiple locales and has 95% of the
> computer market -


Not really: http://en.wikipedia.org/wiki/Usage_share_of_operating_systems

Anyway, if we did everything the way Microsoft suggested, we would give up
real sym links and litter the filesystem with .lnk files, too.

it doesn't have case sensitive file systems. Mac OS
> X by default doesn't either (though they are nice enough to give you
> the choice). I think Linux should give you the choice too.
>
> Linux does give you the choice, in a sense.  You can format many of the
filesystems as case insensitive, and I am fairly sure Linux will still boot
fine.  I use the case sensitive option on Mac OS X, btw.


> Anyway, hopefully my newly formatted JFS partitions will sort this out.
>
> >  At the end of the day, a computer thinks that "a" is 97 and "A" is 65,
> but
> > what humans perceive is more complicated.
>
> And a computer should serve a human, not the other way round.  Read
> the excellent book "About Face 3".
>
> Perhaps, but that that means is up to interpretation.  I interpret is as
"do what I say and don't second-guess me".  If you really want to give the
user what they want, then you have to let them use any file names and
identifier names they want, with any characters, and do full Unicode case
collapsing and normalization.

At any rate, this is probably not the domain to deal with in FPC, all we
can do is support the OS policy.

more info:
http://en.wikipedia.org/wiki/Filename#Case:_upper.2C_lower.2C_preservation

As any rate, to bring this back to a Pascal related discussion:
1. FPC works with case sensitive and case insensitive filesystems quite
well.
2. FPC tries to mangle the case to come common cases in order to handle
legacy code on
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120228/3f5518fc/attachment.html>


More information about the fpc-pascal mailing list