System.Directory (was RE: Proposal for a new I/O library design)

John Meacham john@repetae.net
Mon, 28 Jul 2003 15:36:41 -0700


On Mon, Jul 28, 2003 at 07:51:51PM +0200, Wolfgang Thaller wrote:
> >>isCaseSensitive :: Bool
> >>False on Windows, True on (all?) unices, i have no idea on macs
> 
> It's not that easy. Case sensitivity is a property of a file system, 
> not of the operating system.
> So if you mount a Windows or Mac OS volume on a Linux system, the 
> filenames on that volume will still be case-insensitive (but 
> case-preserving).
> On Mac OS X, the default file system type is HFS+ (a.k.a. Mac OS 
> Extended), which is case insensitive, but you can also choose UFS (case 
> sensitive). You could also have both, on two partitions.
> Of course, "False" for Windows and MacOS, "True" for everything else is 
> a reasonable guess, but you can't rely on it.
> Right now I have no idea how to implement something like

> isCaseSensitive :: FilePath -> IO Bool

See 'statfs(2)' and 'fstatfs(2)', there should be enough info there to
implement it. plus an interface to the other information returned by
these functions would be useful.

perhaps we need a standard trinary data type, True,False,Unknown. I
guess (Maybe Bool) works.
        John


-- 
---------------------------------------------------------------------------
John Meacham - California Institute of Technology, Alum. - john@foo.net
---------------------------------------------------------------------------