|
Re: [GHC] #679: using ReadWriteMode in Windows corrupts files: msg#00071lang.haskell.glasgow.bugs
#679: using ReadWriteMode in Windows corrupts files -------------------------------+-------------------------------------------- Reporter: aljee@xxxxxxxx | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 6.4.1 Severity: normal | Resolution: Keywords: | Os: Windows Difficulty: Moderate (1 day) | Architecture: Unknown -------------------------------+-------------------------------------------- Changes (by simonmar): * difficulty: Unknown => Moderate (1 day) * milestone: 6.4.2 => Comment: Looking at the code, I see the problem. Seeking backwards to flush the read buffer doesn't work on text files in Windows, at least not without recording the file position before reading the buffer. The translation isn't invertible; we can't fix this by counting newlines in the buffer. I'm going to punt on this for 6.4.2. Workarounds are to use NoBuffering, or open the file in binary mode. A quick fix would be to count newlines in the buffer, but that's not completely correct since the newline translation isn't invertible. Strictly speaking we have to call lseek to get the current offset before reading a buffer, and cache this value for later flushing. -- Ticket URL: <http://cvs.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: [GHC] #696: segmentation fault in ./genprimopcode (x86_64), GHC |
|---|---|
| Next by Date: | [GHC] #703: all binaries built by ghc have executable stacks, GHC |
| Previous by Thread: | Re: [GHC] #679: using ReadWriteMode in Windows corrupts files, GHC |
| Next by Thread: | Re: [GHC] #672: INLINE pragmas for default methods don't work, GHC |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |