[Mono-bugs] [Bug 44253][Nor] Changed - FileInfo.MoveTo does not refresh the FileInfo Properties

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 8 Jun 2003 17:56:25 -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 jluke@cfl.rr.com.

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

--- shadow/44253	Fri Jun  6 14:45:03 2003
+++ shadow/44253.tmp.25732	Sun Jun  8 17:56:25 2003
@@ -1,16 +1,16 @@
 Bug#: 44253
 Product: Mono/Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
-Component: System
+Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: jluke@cfl.rr.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
@@ -51,6 +51,32 @@
 How often does this happen? 
 always on .24
 
 Additional Information:
 I ran it on MS.NET 1.0 to get expected results
 I do not have MS.NET 1.1 or cvs mcs/mono to try it on.
+
+------- Additional Comments From jluke@cfl.rr.com  2003-06-08 17:56 -------
+This seems to fix it:
+
+Index: FileInfo.cs
+===================================================================
+RCS file: /cvs/public/mcs/class/corlib/System.IO/FileInfo.cs,v
+retrieving revision 1.16
+diff -u -r1.16 FileInfo.cs
+--- FileInfo.cs 2 Jun 2003 14:18:03 -0000       1.16
++++ FileInfo.cs 8 Jun 2003 22:05:26 -0000
+@@ -141,6 +141,7 @@
+                                MonoIO.ExistsDirectory (dest, out error))
+                                throw new IOException ();
+                        File.Move (FullPath, dest);
++                       this.FullPath = Path.GetFullPath (dest);
+                }
+  
+                public FileInfo CopyTo (string path) {
+@@ -162,4 +163,4 @@
+                        return OriginalPath;
+                }
+        }
+-}
++}
+