[Mono-bugs] [Bug 24940] New - FileDelete (non_existent_file) raises unhandled exception
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
19 May 2002 16:37:06 -0000
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 loz@cable.a2000.nl.
http://bugzilla.ximian.com/show_bug.cgi?id=24940
--- shadow/24940 Sun May 19 12:37:06 2002
+++ shadow/24940.tmp.23418 Sun May 19 12:37:06 2002
@@ -0,0 +1,57 @@
+Bug#: 24940
+Product: Mono/Runtime
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: loz@cable.a2000.nl
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: FileDelete (non_existent_file) raises unhandled exception
+
+When trying to delete an non-existent-file using File.Delete method an
+unhandled exception is raised. Example:
+
+using System.IO;
+
+class T25
+{
+ public static void Main ()
+ {
+ string tmpFilename = "e:/cygwin/tmp/NotExists.tmp";
+ File.Delete (tmpFilename);
+ }
+}
+
+results in:
+
+(process:1300): ** WARNING **: unhandled exception
+System.IO.IOException: "Win32
+ IO returned ERROR_SUCCESS"
+#0: 0x00094 throw in System.IO.File::Delete ([00BC0F00] )
+#1: 0x00007 call in .T25::Main ()
+
+Apparently MonoIO.getException doesn't return a FileNotFoundException as
+is expected.
+
+
+I thought about ending io.c DeleteFile function with:
+
+ if (ret==0)
+ return(TRUE);
+ _wapi_set_last_error_from_errno();
+ return(FALSE);
+
+but this doesn't get compiled on cygwin.
+
+
+
+Greets,
+Lawrence