Merge pull request #2869 from BrzVlad/feature-mod-union-opt
[mono.git] / mcs / class / corlib / System.IO / Directory.cs
index baa366a7efbc309f2c5f4b345cec3aa567b1efe8..3c7e87a6b7ac78ad8fbe13e42343fb67337d0698 100644 (file)
@@ -72,8 +72,6 @@ namespace System.IO
                        if (File.Exists(path))
                                throw new IOException ("Cannot create " + path + " because a file with the same name already exists.");
                        
-                       // LAMESPEC: with .net 1.0 version this throw NotSupportedException and msdn says so too
-                       // but v1.1 throws ArgumentException.
                        if (Environment.IsRunningOnWindows && path == ":")
                                throw new ArgumentException ("Only ':' In path");
                        
@@ -98,7 +96,7 @@ namespace System.IO
                                 info.Parent.Create ();
 
                        MonoIOError error;
-                       if (!MonoIO.CreateDirectory (path, out error)) {
+                       if (!MonoIO.CreateDirectory (info.FullName, out error)) {
                                // LAMESPEC: 1.1 and 1.2alpha allow CreateDirectory on a file path.
                                // So CreateDirectory ("/tmp/somefile") will succeed if 'somefile' is
                                // not a directory. However, 1.0 will throw an exception.
@@ -500,7 +498,6 @@ namespace System.IO
                        return result;
                }
 
-#if NET_4_0
                public static string[] GetFileSystemEntries (string path, string searchPattern, SearchOption searchOption)
                {
                        // Take the simple way home:
@@ -634,7 +631,6 @@ namespace System.IO
                        return EnumerateKind (path, "*", SearchOption.TopDirectoryOnly, FileAttributes.Normal | FileAttributes.Directory);
                }
                
-#endif
 
                public static DirectorySecurity GetAccessControl (string path, AccessControlSections includeSections)
                {