[Haskell] Read and write file on Windows XP.

Tomasz Zielonka tomasz.zielonka at gmail.com
Sun Apr 24 13:56:34 EDT 2005


On Sun, Apr 24, 2005 at 06:01:34PM +0200, Alexandre Weffort Thenorio wrote:
> outputLine keyno key orgFile = do
>                                                 -- Some code that modifies
> second line here
>                                                 newHexFile <- openFile
> "newint.hex" WriteMode
>                                                  hPutStrLn newHexFile
> (orgFile!!0 ++ "\n" ++ final ++ unlines (drop 2 orgFile))
> 
> What happens is everything works fine on my PC (Windows 2000) but on another
> PC (Using Windows XP) it sometimes gives a file which is incomplete, a
> couple of lines missing in the end making the file smaller and wrong.

Maybe try hClose'ing the newHexFile at the end of outputLine...?

Best regards
Tomasz


More information about the Haskell mailing list