System.FilePath propsal (Was: Cabal feedback notes)
Krasimir Angelov
ka2_mail at yahoo.com
Tue Oct 26 14:23:40 EDT 2004
normalizeCase is an equivalen of normcase from
OS.Path. I also wondered whether this function is
useful at all but decided to add it for completeness.
I tend to agree to remove it.
Cheers,
Krasimir
--- Wolfgang Thaller <wolfgang.thaller at gmx.net> wrote:
> > -- | Normalize the case of a file path. On Unix,
> this returns the path
> > unchanged;
> > -- on case-insensitive filesystems, it converts
> the path to lowercase.
> > -- On Windows, it also converts forward slashes to
> backward slashes.
> > normalizeCase :: FilePath -> FilePath
>
> I'm afraid I don't like this function. The
> case-insensitive file
> systems used on Windows and Mac OS X by default are
> _case-preserving_
> [well, FAT32 is almost case-preserving], so if you
> use normalizeCase in
> any other situation than normalizeCase a ==
> normalizeCase b, then it'll
> probably be wrong.
>
> Also, it has been discussed before that Mac OS X,
> Linux, and probably
> even Windows support mounting both case-sensitive
> and case-insensitive
> file systems. So whether a file name should be case
> sensitive really
> depends on where a file is.
> So maybe we need
>
> normalizeCase :: FilePath -> IO FilePath
>
> ... where the FilePath must refer to an existing
> file or directory.
> That's definitely not a simple path utility function
> any more.
>
> Are there enough situations where the simple but not
> quite correct pure
> normalizeCase function would be The Right Thing (or
> at least
> Sufficiently Close To The Right Thing)?
>
> Cheers,
>
> Wolfgang
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
More information about the Libraries
mailing list