|
[GHC] #679: using ReadWriteMode in Windows corrupts files: msg#00187lang.haskell.glasgow.bugs
#679: using ReadWriteMode in Windows corrupts files -------------------------------+-------------------------------------------- Reporter: aljee@xxxxxxxx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 6.4.1 Severity: normal | Keywords: Os: Windows | Difficulty: Unknown Architecture: Unknown | -------------------------------+-------------------------------------------- In Windows, running the following program makes test.txt corrupted. {{{ import System.IO main = do h <- openFile "test.txt" ReadWriteMode hGetLine h hPutStrLn h "yz" hClose h }}} Initial content of test.txt is: {{{ ab cd ef gh }}} Expected content of test.txt after the excution is: {{{ ab yz ef gh }}} Actual result is(in hex): 61 62 0d 0a 63 64 0d 79 7a 0d 0a 0a 67 68 0d 0a I think that the problem is that GHC.Handle.flushReadBuffer does not calculate the correct amount of seek to be done. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/679> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler_______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: "-optc-O3" plus "-prof" gcc failure, Simon Marlow |
|---|---|
| Next by Date: | Re: [GHC] #675: Bad error message in GHCi, GHC |
| Previous by Thread: | [GHC] #678: Non-terminating compilation of ghc on Debian Testing i386, GHC |
| Next by Thread: | Space leak, Ian Lynagh |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |