Skip to content

Commit

Permalink
2010-01-31 Zoltan Varga <vargaz@gmail.com>
Browse files Browse the repository at this point in the history
	* Directory.cs (Exists): Never throw an exception. Fixes #565152.

svn path=/branches/mono-2-6/mcs/; revision=150606
  • Loading branch information
vargaz committed Jan 31, 2010
1 parent 34fb8bd commit 8530226
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
4 changes: 4 additions & 0 deletions mcs/class/corlib/System.IO/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2010-01-31 Zoltan Varga <vargaz@gmail.com>

* Directory.cs (Exists): Never throw an exception. Fixes #565152.

2010-01-14 Rolf Bjarne Kvinge <RKvinge@novell.com>

* UnmanagedMemoryStream.cs: Read: don't read bytes one-by-one, read all
Expand Down
15 changes: 2 additions & 13 deletions mcs/class/corlib/System.IO/Directory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,8 @@ public static bool Exists (string path)
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)
Expand Down

0 comments on commit 8530226

Please sign in to comment.