[Mono-bugs] [Bug 57742][Wis] New - FileStream.Seek gives incorrect results unless flushed first.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 27 Apr 2004 17:56:01 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by roberts@refactory.com.

http://bugzilla.ximian.com/show_bug.cgi?id=57742

--- shadow/57742	2004-04-27 17:56:01.000000000 -0400
+++ shadow/57742.tmp.26959	2004-04-27 17:56:01.000000000 -0400
@@ -0,0 +1,69 @@
+Bug#: 57742
+Product: Mono: Class Libraries
+Version: unspecified
+OS: other
+OS Details: Gentoo
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: roberts@refactory.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: FileStream.Seek gives incorrect results unless flushed first.
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+Seeking to the end of a FileStream after a write and before a flush loses 
+data.
+
+Steps to reproduce the problem:
+1. Compile and run this code:
+
+using System;
+using System.IO;
+
+class Test {
+  public static void Main(String[]  args) {
+    FileStream fs = new FileStream("foo.txt", FileMode.OpenOrCreate, 
+FileAccess.Write);
+    fs.WriteByte(48);
+    fs.WriteByte(48);
+    fs.WriteByte(48);
+    Console.WriteLine(fs.Position);
+    //  fs.Flush();    // uncomment to make the code work.
+    fs.Seek(0, SeekOrigin.End);
+    fs.WriteByte(54);
+    fs.WriteByte(54);
+    fs.WriteByte(54);
+    Console.WriteLine(fs.Position);
+    fs.Close();
+  }
+
+}
+
+
+Actual Results:
+output:
+3
+3
+
+foo.txt contains: 666
+
+Expected Results: (observed under Windoze)
+output:
+3
+6
+
+foo.txt contains: 000666
+
+How often does this happen? 
+
+
+Additional Information: