[Mono.Posix] Add UnixFileSystemInfo.TryGetFileSystemEntry()
authorJonathan Pryor <jonpryor@vt.edu>
Tue, 6 Mar 2012 13:08:07 +0000 (08:08 -0500)
committerJonathan Pryor <jonpryor@vt.edu>
Tue, 6 Mar 2012 13:13:37 +0000 (08:13 -0500)
commit14c86dfd6e3d7080e823c4437c24469fc504ad78
treec02265c63b2049e6ed97c3b83888fd377a3c375b
parentac759e6aa95e6eb32f9fa7f2fe976047fc87deeb
[Mono.Posix] Add UnixFileSystemInfo.TryGetFileSystemEntry()

UnixFileSystemInfo.GetFileSystemEntry() throws a
DirectoryNotFoundException when provided an invalid path (e.g.
/path/to/filename.ext/extra), because lstat(2) returns ENOTDIR.

Add UnixFileSystemInfo.TryGetFileSystemEntry() as a non-throwing
variant which returns the UnixFileSystemInfo as an `out` parameter.
This allows avoiding the exception, if desired.
mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs