2010-01-31 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sun, 31 Jan 2010 19:17:34 +0000 (19:17 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sun, 31 Jan 2010 19:17:34 +0000 (19:17 -0000)
* Directory.cs (Exists): Never throw an exception. Fixes #565152.

svn path=/trunk/mcs/; revision=150605

mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/Directory.cs

index 3af5a40c7786e8b9d9001f65be540939fcfd2df9..3af8d7c1148f15eccf9ae0d27f187f26eb925146 100644 (file)
@@ -1,3 +1,7 @@
+2010-01-31  Zoltan Varga  <vargaz@gmail.com>
+
+       * Directory.cs (Exists): Never throw an exception. Fixes #565152.
+
 2010-01-28 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * UnmanagedMemoryStream.cs: fix a regression from my previous patch.
index 05c6b2b67ef721e101f42c79f8788eac79db7ffc..79660b67102989915c203cd36884cae18d50101e 100644 (file)
@@ -199,19 +199,8 @@ namespace System.IO
                        bool exists;
                        
                        exists = MonoIO.ExistsDirectory (path, out error);
-                       if (error != MonoIOError.ERROR_SUCCESS &&
-                           error != MonoIOError.ERROR_PATH_NOT_FOUND &&
-                           error != MonoIOError.ERROR_INVALID_HANDLE &&
-                           error != MonoIOError.ERROR_ACCESS_DENIED) {
-
-                               // INVALID_HANDLE might happen if the file is moved
-                               // while testing for the existence, a kernel issue
-                               // according to Larry Ewing.
-                               
-                               throw MonoIO.GetException (path, error);
-                       }
-
-                       return(exists);
+                       /* This should not throw exceptions */
+                       return exists;
                }
 
                public static DateTime GetLastAccessTime (string path)