[Haskell-cafe] Encoding-aware System.Directory functions

Richard O'Keefe ok at cs.otago.ac.nz
Fri Apr 1 00:47:36 CEST 2011


On 31/03/2011, at 9:13 PM, Ketil Malde wrote:

> John Millikin <jmillikin at gmail.com> writes:
> 
>> OSX's chief weirdness is that its GUI programs swap ':' and '/' when 
>> displaying filenames. 
> 
> A remnant from the bad old days of MacOS <10, where : was the path
> separator, and / was a perfectly good character to use in filenames.

And indeed very frequently used for dates.  There had to be _some_ way
to deal with old file names in the new OS.

From a UNIX point of view, one peculiarity of the Mac OS X native file
system is that while case preserving for creation, it is case
insensitive for lookup.  On my Mac laptop, where everything is native,
this actually works very pleasantly, although it does mean that
"fn1 and fn2 are equivalent for lookup, whatever the state of the
file system" and "fn1 and fn2 are equivalent for creation, whatever
the state of the file system" are different propositions.  On my Mac
desktop, where _some_ directories are native and _some_ are NFS, it
can get confusing.

If memory serves me, Mac OS Classic recorded the script of each file
name, so in a multidirectory path foo:bar:ugh:zoo each component might
be byte encoded in a different script...




More information about the Haskell-Cafe mailing list