id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
679	using ReadWriteMode in Windows corrupts files	aljee@…	simonmar	"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."	bug	closed	normal	6.6	libraries/base	6.4.1	fixed			Windows	Unknown/Multiple		Easy (less than 1 hour)				
