[squeak-dev] file name case sensitivity

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed May 14 19:48:02 UTC 2014


2014-05-11 19:12 GMT+02:00 Eliot Miranda <eliot.miranda at gmail.com>:

> Hi All,
>
>     being a control freak I always enable case sensitivity on my Macs.
>  The Mac OS X file system has optional case sensitivity, insensitive by
> default.  I once got burned with a check-out where one directory overwrite
> another and chose sensitivity from then on.  This has caused a few problems
> over the years, including a Flash update that failed.  No matter.
>
> Squeak has FileDirectory class>>isCaseSensitive answer a hard-coded
> boolean.  Not good.  I see this from stackoverflow<http://stackoverflow.com/questions/430256/how-do-i-determine-whether-the-filesystem-is-case-sensitive-in-net>
> :
>
> "Keep in mind that you might have multiple file systems with different
> casing rules. For example, the root filesystem could be case-sensitive, but
> you can have a case-insensitive filesystem (e.g. an USB stick with a FAT
> filesystem on it) mounted somewhere. So if you do such checks, make sure
> that you make them in the directory that you are going to access.
>
> Also, what if the user copies the data from say a case-sensitive to a
> case-insensitive file system? If you have files that differ only by case,
> one of them will overwrite the other, causing data loss. When copying in
> the other direction, you might also run into problems, for example, if file
> A contains a reference to file "b", but the file is actually named "B".
> This works on the original case-insensitive file system, but not on the
> case-sensitive system.
>
> Thus I would suggest that you avoid depending on whether the file system
> is case-sensitive or not if you can. Do not generate file names that differ
> only by case, use the standard file picker dialogs, be prepared that the
> case might change, etc."
>
> Luckily this is only tested in a couple of places.  Most of the time the
> system resolves names by going through primDirectoryEntryFor: which leaves
> it up to the individual file system to decide (and hence get the answer
> right).
> I wonder what does FileSystem do about this?
> --
> best,
> Eliot
>
>
> Not better it seems... It's hardcoded too.

UnixStore class>>isCaseSensitive
    "except for OSX the default is case sensitive"
    ^ Smalltalk os isMacOSX not

Though, it's only used in one place in Pharo 3.0: ExternalDropHandler to
test file extension matching (matchesExtension:).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140514/7a908889/attachment.htm


More information about the Squeak-dev mailing list