copyFile on Windows dies with binary files

Neil Mitchell ndmitchell at gmail.com
Thu Mar 22 10:52:12 EDT 2007


Hi,

copyFile on Windows with a binary file doesn't work terribly well - it
truncates at the first binary zero.

The code goes:

copyFile :: FilePath -> FilePath -> IO ()
copyFile fromFPath toFPath =
	do readFile fromFPath >>= writeFile toFPath
	   try (copyPermissions fromFPath toFPath)
	   return ()

That should be openFileBinary etc.

Thanks

Neil


More information about the Hugs-Bugs mailing list