[Mono-bugs] [Bug 54443][Nor] New - TempFileCollection doesn't delete files

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 16 Feb 2004 19:59:59 -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 krisolav@hotmail.com.

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

--- shadow/54443	2004-02-16 19:59:59.000000000 -0500
+++ shadow/54443.tmp.9198	2004-02-16 19:59:59.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 54443
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: krisolav@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TempFileCollection doesn't delete files
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+The TempFileCollection doesn't delete files after a "using" block and 
+after calling Delete() manually.
+
+Steps to reproduce the problem:
+1. Execute the following:
+     using (TempFileCollection tempFiles = new TempFileCollection())
+     {
+          string name = tempFiles.AddExtension("crawler.conf", false);
+          System.Console.Out.WriteLine(name);
+          using (StreamWriter writer = new StreamWriter(name, false)) 
+          {
+               writer.Write("hello");
+          }
+
+          // Uncommenting the following doesn't help.
+          // tempFiles.Delete();
+     }
+
+2. 
+3. 
+
+Actual Results:
+File is created, but is not deleted (even w/ the Delete() call).
+
+Expected Results:
+File is deleted
+
+How often does this happen? 
+Every time
+
+Additional Information:
+Calling AddExtension() doesn't look like it will try to avoid file 
+conflicts.  It never checks for the existence of a temporary file, so it 
+seems possible that it occaisionally ends up getting back the name of an 
+existing file.