+2003-06-02 Nick Drochak <ndrochak@gol.com>
+
+ * FileInfo.cs (MoveTo): Throw exceptions when dest exists, and check
+ for null too.
+
2003-05-27 Lluis Sanchez Gual <lluis@ximian.com>
* BinaryReader.cs: Stream don't need to be seekable to use PeekChar.
}
}
- public void MoveTo (string dest) {\r
- File.Move (FullPath, dest);\r
- }\r
-\r
+ public void MoveTo (string dest) {
+ if (dest == null)
+ throw new ArgumentNullException ();
+ MonoIOError error;
+ if (MonoIO.Exists (dest, out error) ||
+ MonoIO.ExistsDirectory (dest, out error))
+ throw new IOException ();
+ File.Move (FullPath, dest);
+ }
+
public FileInfo CopyTo (string path) {\r
return CopyTo (path, false);\r
}\r