[Mono-bugs] [Bug 71293][Cos] New - Deleting an open stream should fail.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 14 Jan 2005 17:55:51 -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 miguel@ximian.com.

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

--- shadow/71293	2005-01-14 17:55:51.000000000 -0500
+++ shadow/71293.tmp.12818	2005-01-14 17:55:51.000000000 -0500
@@ -0,0 +1,49 @@
+Bug#: 71293
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Deleting an open stream should fail.
+
+Not sure if it should, Unix semantics and stuff:
+
+This in .NET prints OK, dont know if its worth fixing:
+using System.Globalization;
+using System;
+using System.IO;
+
+class X {
+	static void Main ()
+	{
+			string path = "DeleteOpenStreamException";
+			File.Delete (path);			
+			FileStream stream = null;
+			try {
+				stream = new FileStream (path, FileMode.OpenOrCreate,
+FileAccess.ReadWrite);
+				try {
+					File.Delete (path);
+				} catch (IOException){
+					Console.WriteLine ("OK");
+				}
+				
+			} finally {
+				if (stream != null)
+					stream.Close ();
+				File.Delete (path);
+			}
+
+		
+	}
+}