
On 13/11/2011 19:41, Ganesh Sittampalam wrote:
Hi,
I'm not entirely clear on what the overall situation will be once Simon M's patch to add .ByteString versions to unix is added in GHC 7.4.1.
In particular the original problem darcs ran into was with getDirectoryContents in the directory package. That in turn uses the unix package on Posix systems and another code path based on Win32 on Windows (http://hackage.haskell.org/packages/archive/directory/1.1.0.1/doc/html/src/S...)
So a couple of questions:
(1) Does Win32 need similar additions? I can't spot any substantial changes to it for Max's PEP383, but I'm not sure if any lower-level library changes might have affected it.
No - Win32 file paths cannot by definition contain invalid Unicode. The existing Win32 library is fine.
(2) What's the recommended way of doing the equivalent of getDirectoryContents for RawFilePath? Do we also need to add "raw" versins to the directory package?
getDirectoryContents :: RawFilePath -> IO [RawFilePath] getDirectoryContents path = do bracket (Posix.openDirStream path) Posix.closeDirStream loop where loop dirp = do e <- Posix.readDirStream dirp if B.null e then return [] else do es <- loop dirp return (e:es) Cheers, Simon