copyFile function in Haddock, VSHaskell & Cabal

Krasimir Angelov ka2_mail at
Thu Jul 29 03:18:45 EDT 2004

    I have found a bug in CVS Haddock. It uses the
following definition of copyFile function:

copyFile f = do
	s <- readFile (libdir ++ pathSeparator:f)
	writeFile (odir ++ pathSeparator:f) s

(See HaddockHtml.hs)

This works well for text files but the function fails
when it is used to copy binary files under Windows.
Similar functions are used also in VSHaskell and
Cabal. I propose to add copyFile function to
System.Directory which will take care of binary files.
The function signature is simple:

copyFile :: FilePath -> FilePath -> IO ()

In the attached file there are two implementations.
The first is a more portable but slower and the second
is GHC specific but is faster.

Any suggestions

Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage! 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CopyFile.hs
Type: application/octet-stream
Size: 2379 bytes
Desc: CopyFile.hs
Url :

More information about the Libraries mailing list