behaviour change in getDirectoryContents in GHC 7.2?

Max Bolingbroke batterseapower at hotmail.com
Thu Nov 3 10:41:32 CET 2011


On 2 November 2011 21:46, Ganesh Sittampalam <ganesh at earth.li> wrote:
> The workaround you propose seems a little complex and it might be a bit
> problematic that 100% roundtripping can't be guaranteed even once your
> fix is applied.

I can understand this perspective, although the roundtripping as
implemented will only fail in certain very obscure cases.

> Do you think it would be reasonable/feasible for darcs
> to have its own version of getDirectoryContents that doesn't try to do
> any translation in the first place? It might make sense to make a
> separate package that others could use to.

Yes, absolutely! I think a very valuable contribution would be a
package providing filesystem functions (with an abstract FilePath
type) that is portable across Windows, OS X and *nix-like OSes. This
would be a useful package for anyone who wants to avoid the
performance (and very rare correctness) problems associated with
roundtripping.

> BTW I was trying to find the patch where this changed but couldn't - was
> it a consequence of
> https://github.com/ghc/packages-base/commit/509f28cc93b980d30aca37008cbe66c677a0d6f6
> ?

That is the main patch. I had to patch the libraries as well to make
use of the changed encodings. See (for example)
https://github.com/ghc/packages-unix/commit/bb8a27d14a63fcd126a924d32c69b7694ea709d9

Max



More information about the Glasgow-haskell-users mailing list