throw new ArgumentException ("src");\r
if (dest.Trim () == "" || dest.IndexOfAny (Path.InvalidPathChars) != -1)\r
throw new ArgumentException ("dest");\r
- if (src.IndexOf(':') > 1)\r
- throw new NotSupportedException("src");\r
- if (dest.IndexOf(':') > 1)\r
- throw new NotSupportedException("dest");\r
- if (!Exists (src)) {\r
+ if (!Exists (src))
throw new FileNotFoundException (src + " does not exist");\r
- }\r
- else {\r
- if ((GetAttributes(src) & FileAttributes.Directory) == FileAttributes.Directory){\r
- throw new ArgumentException(src + " is a directory"); \r
- }\r
- }\r
+
+ if ((GetAttributes(src) & FileAttributes.Directory) == FileAttributes.Directory){
+ throw new ArgumentException(src + " is a directory");
+ }
+
if (Exists (dest)) {\r
if ((GetAttributes(dest) & FileAttributes.Directory) == FileAttributes.Directory){\r
throw new ArgumentException(dest + " is a directory"); \r
}\r
\r
string DirName = Path.GetDirectoryName(dest);\r
- if (!Directory.Exists (DirName))\r
- throw new DirectoryNotFoundException("Destination directory not found: " + DirName);\r
+ if (DirName != String.Empty && !Directory.Exists (DirName))
+ throw new DirectoryNotFoundException("Destination directory not found: " + DirName);
\r
if (!MonoIO.CopyFile (src, dest, overwrite))\r
throw MonoIO.GetException ();\r
throw new ArgumentNullException("path");\r
if (String.Empty == path.Trim() || path.IndexOfAny(Path.InvalidPathChars) >= 0)\r
throw new ArgumentException("path");\r
- if (path.IndexOf(':') > 1)\r
- throw new NotSupportedException();\r
\r
string DirName = Path.GetDirectoryName(path);\r
if (DirName != String.Empty && !Directory.Exists (DirName))\r
throw new ArgumentNullException("path");\r
if (String.Empty == path.Trim() || path.IndexOfAny(Path.InvalidPathChars) >= 0)\r
throw new ArgumentException("path");\r
- if (path.IndexOf(':') > 1)\r
- throw new NotSupportedException();\r
if (Directory.Exists (path))\r
throw new UnauthorizedAccessException("path is a directory");\r
\r
string DirName = Path.GetDirectoryName(path);\r
- if (DirName.Length > 0 && !Directory.Exists (DirName))\r
+ if (DirName != String.Empty && !Directory.Exists (DirName))\r
throw new DirectoryNotFoundException("Destination directory not found: " + DirName);\r
\r
if (!MonoIO.DeleteFile (path)){\r
// is any problem with the path or permissions. Minimizes what information can be\r
// discovered by using this method.\r
if (null == path || String.Empty == path.Trim() \r
- || path.IndexOfAny(Path.InvalidPathChars) >= 0\r
- || path.IndexOf(':') > 1)\r
+ || path.IndexOfAny(Path.InvalidPathChars) >= 0)
return false;\r
\r
return MonoIO.ExistsFile (path);\r
throw new ArgumentNullException("path");\r
if (String.Empty == path.Trim() || path.IndexOfAny(Path.InvalidPathChars) >= 0)\r
throw new ArgumentException("path");\r
- if (path.IndexOf(':') > 1)\r
- throw new NotSupportedException();\r
-\r
- string DirName = Path.GetDirectoryName(path);\r
- if (!Directory.Exists(DirName))\r
- throw new DirectoryNotFoundException("Directory '" + DirName + "' not found in '" + Environment.CurrentDirectory + "'.");\r
\r
return MonoIO.GetFileAttributes (path);\r
}\r
throw new ArgumentException ("src");\r
if (dest.Trim () == "" || dest.IndexOfAny (Path.InvalidPathChars) != -1)\r
throw new ArgumentException ("dest");\r
- if (src.IndexOf(':') > 1)\r
- throw new NotSupportedException("src");\r
- if (dest.IndexOf(':') > 1)\r
- throw new NotSupportedException("dest");\r
if (!Exists (src))\r
throw new FileNotFoundException (src + " does not exist");\r
if (Exists (dest) && ((GetAttributes(dest) & FileAttributes.Directory) == FileAttributes.Directory))\r
\r
string DirName;\r
DirName = Path.GetDirectoryName(src);\r
- if (!Directory.Exists (DirName))\r
+ if (DirName != String.Empty && !Directory.Exists (DirName))\r
throw new DirectoryNotFoundException("Source directory not found: " + DirName);\r
DirName = Path.GetDirectoryName(dest);\r
- if (!Directory.Exists (DirName))\r
+ if (DirName != String.Empty && !Directory.Exists (DirName))\r
throw new DirectoryNotFoundException("Destination directory not found: " + DirName);\r
\r
if (!MonoIO.MoveFile (src, dest))\r