copyFile function in Haddock, VSHaskell & Cabal

Krasimir Angelov ka2_mail at yahoo.com
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
  Krasimir



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CopyFile.hs
Type: application/octet-stream
Size: 2379 bytes
Desc: CopyFile.hs
Url : http://www.haskell.org//pipermail/libraries/attachments/20040729/fb4e2c6f/CopyFile-0001.obj


More information about the Libraries mailing list