[Mono-bugs] [Bug 55173][Nor] New - System.IO.BinaryWriter behavior difference between mono and MS.NET

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 4 Mar 2004 14:31:27 -0500 (EST)


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 dmitriyk@comcast.net.

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

--- shadow/55173	2004-03-04 14:31:27.000000000 -0500
+++ shadow/55173.tmp.27906	2004-03-04 14:31:27.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 55173
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: Tested on MacOS X and Windows XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dmitriyk@comcast.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.IO.BinaryWriter behavior difference between mono and MS.NET
+
+Description of Problem:
+If you create a file using BinaryWriter, write to it, immediately close it, and check for its existance, 
+mono returns a false and MS.NET returns a true;
+
+Steps to reproduce the problem:
+1. Use the code:
+
+using System;
+using System.IO;
+
+public class monotest{
+	public static void Main(string[] args){
+		FileInfo TestFile = new FileInfo("test.file");
+		BinaryWriter TestFileWriter = new 
+BinaryWriter(TestFile.Open(FileMode.Create,FileAccess.ReadWrite));
+		
+		TestFileWriter.Write(new byte[]{0,1,2});
+		TestFileWriter.Close();
+		
+		if(TestFile.Exists)
+			Console.WriteLine("Test file exists.");
+		else
+			Console.WriteLine("Test file does not exist.");
+	}
+}
+
+2. Compile using 'mcs test.cs'
+3. Run using 'mono test.cs'
+
+Actual Results:
+mono 0.30.2 in MacOS X and mono 0.30 in Windows XP report:
+'Test file does not exist.'
+
+Expected Results:
+Microsoft .NET 1.1 runtime in Windows XP reports:
+'Test file exists.'