[Mono-bugs] [Bug 44959][Nor] New - different system.io.filestream behavior between .net and mono

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 17 Jun 2003 02:37: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 joerg.wuerzer@ixos.de.

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

--- shadow/44959	Tue Jun 17 02:37:01 2003
+++ shadow/44959.tmp.12447	Tue Jun 17 02:37:01 2003
@@ -0,0 +1,86 @@
+Bug#: 44959
+Product: Mono/Class Libraries
+Version: unspecified
+OS: unknown
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: joerg.wuerzer@ixos.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: different system.io.filestream behavior between .net and mono
+
+running system: redhat 8, mono 0.24-2 (rpm install).
+
+following code compiled with .net 
+doesn't run under mono/linux but under
+win/.net.
+
+// -->
+using System;
+using 
+System.IO;
+
+namespace FileStreamTest
+{
+ class Class1
+ {
+  static void 
+Main(string[] args)
+  {
+   FileStream fs = new
+   FileStream("test",FileMode.Append); 
+//here is the difference
+   StreamWriter sw = new StreamWriter(fs);
+   
+sw.WriteLine("test");
+   sw.Close();
+   fs.Close();
+  }
+ }
+}
+// <--
+
+under 
+win/.net this code works fine, but under linux/mono following error
+message below 
+returns.
+
+** (process:1983): WARNING **: Shared memory sanity check failed.
+
+** 
+(process:1983): WARNING **: Failed to attach shared memory! Falling back
+to non-shared 
+handles
+
+Unhandled Exception: System.ArgumentException: Append streams can not 
+be
+read
+in <0x00258> 00 
+System.IO.FileStream:.ctor
+(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool
+)
+in 
+<0x00045> 00 System.IO.FileStream:.ctor (string,System.IO.FileMode)
+in <0x0003a> 
+00 FileStreamTest.Class1:Main (string[])
+
+so I explicitly must define 
+FileAccess.Write in my FileStream object
+creation. See below.
+
+// -->
+FileStream fs 
+= new FileStream("test",FileMode.Append,FileAccess.Write);
+// <--
+
+this doesn't 
+matter if known, but it's a different behavior.
+
+have a nice day, Joerg Wuerzer