Mono Class Library: Mono.Unix.UnixDirectoryInfo Overview | Members

Mono.Unix.UnixDirectoryInfo.GetEntries Method

Returnes the directory entries of all file system entries in the UnixFileSystemInfo.FullPath directory that match the provided regular expression regex.

public Mono.Unix.Native.Dirent[] GetEntries (string regex)

Parameters

regex
A string containing a regular expression that is used for matching against directory entry names.

Returns

A Mono.Unix.Native.Dirent array containing all file system entries within the UnixFileSystemInfo.FullPath directory.

Exceptions

TypeReason
UnauthorizedAccessException The process cannot access UnixFileSystemInfo.FullPath. [Mono.Unix.Native.Errno.EACCESS]
System.IO.DirectoryNotFoundExceptionUnixFileSystemInfo.FullPath is not a directory. [Mono.Unix.Native.Errno.ENOTDIR]
System.IO.FileNotFoundExceptionUnixFileSystemInfo.FullPath doesn't exist, or is an empty string. [Mono.Unix.Native.Errno.ENOENT]
Mono.Unix.UnixIOException

Insufficient memory to complete the operation. [Mono.Unix.Native.Errno.ENOMEM]

-or-

Too many file descriptors in use by the process. [Mono.Unix.Native.Errno.EMFILE]

-or-

Too many files are currently open in the system. [Mono.Unix.Native.Errno.ENFILE]

Remarks

regex is matched against Mono.Unix.Native.Dirent.d_name for all file system entries found.

The Mono.Unix.Native.Dirent.d_name field of the returned Mono.Unix.Native.Dirent instances only contains the file system entry name, not the fully qualified file system entry name. Thus, to use these values in further code they must be qualified with UnixFileSystemInfo.FullName, e.g. UnixPath.Combine (UnixFileSystemInfo.FullName, dirent[index].Mono.Unix.Native.Dirent.d_name).

Requirements

Namespace: Mono.Unix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0