[Mono-bugs] [Bug 59574][Nor] New - Directory.Delete(path, true) on Windows raises some errors

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 3 Jun 2004 15:16:41 -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 atsushi@ximian.com.

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

--- shadow/59574	2004-06-03 15:16:41.000000000 -0400
+++ shadow/59574.tmp.14680	2004-06-03 15:16:41.000000000 -0400
@@ -0,0 +1,63 @@
+Bug#: 59574
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Directory.Delete(path, true) on Windows raises some errors
+
+When we use Directory.Delete (string path, bool recursive) with recursive =
+true, it raises an error (may differ in situation) and fails to delete it.
+
+using System;
+using System.IO;
+
+public class Test
+{
+        public static void Main ()
+        {
+                string dir = "enotest/system/io/directory/test";
+                Directory.CreateDirectory (dir);
+                File.Create (dir + "/test.txt").Close ();
+
+                Directory.Delete ("enotest", true);
+        }
+}
+
+Under MS.NET:
+
+ginga@r50 ~/tests
+$ ./del
+
+Under Mono:
+
+ginga@r50 ~/tests
+$ mono del.exe
+
+Unhandled Exception: System.ArgumentException: Illegal characters in path
+Parameter name: path2
+in <0x0012d> System.IO.Path:Combine (string,string)
+in <0x003c1> System.IO.Directory:GetFileSystemEntries
+(string,string,System.IO.F
+ileAttributes,System.IO.FileAttributes)
+in <0x00018> System.IO.Directory:GetFiles (string,string)
+in <0x00010> System.IO.Directory:GetFiles (string)
+in <0x0004c> System.IO.Directory:RecursiveDelete (string)
+in <0x0003a> System.IO.Directory:RecursiveDelete (string)
+in <0x0003a> System.IO.Directory:RecursiveDelete (string)
+in <0x0003a> System.IO.Directory:RecursiveDelete (string)
+in <0x00024> System.IO.Directory:Delete (string,bool)
+in <0x00043> Test:Main ()
+
+How often does this happen? 
+- May vary depending on your directory but consistently happens.