[Haskell-cafe] Re: ANN: System.FilePath 0.9

Neil Mitchell ndmitchell at gmail.com
Wed Jul 26 06:38:51 EDT 2006


> > The main purpose of canoncialPath is to fix the case on Windows, so
> > "c:\my documents\file.doc" becomes "C:\My Documents\file.doc" if that
> Right, as Krasimir pointed out we already have
> System.Directory.canonicalizePath.  Incedentally, this version removes "/../" in
> a symlink-friendly way on Unix, because it uses realpath() underneath.

This is only #idef'd in on GHC, Hugs users have only a dummy return.

Also on Windows it deals with ../, but does not correct the case
differences or replace SHORTN~1 with the proper names.

The correct thing to do of course is to fix up this function, so I'll
give that a go.

It also looks like fullPath is just canonicalizePath, so I'll throw
that out once canonicalize is available properly.

> I'd rather not have duplication because that can lead to confusion too - but at
> least it should be clearly documented.  Certainly we should not have all of
>    joinFileName, combine, addFileName

Well joinFileName and addFileName are mainly used for keeping the
properties consistent, so combine is the real function to use, I'll
drop the other two from the interface.

> since they all do the same thing.  Also,
>    getDirectory, dropFileName
> do the same thing.

I think a rejig of the names is in order, in light of this and your
directoryOf suggestions. I'll find someone who is better at naming and
drag them to a whiteboard.



More information about the Haskell-Cafe mailing list