FilePathGetFiles(DirectoryInfo, String, SearchOption, ActionException) Method

Returns the files that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.

Definition

Namespace: Gemstone.IO
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.165 -- Release Build+e14d337b173ad33e50be6747ce5b02f477f99484
public static FileInfo[] GetFiles(
	DirectoryInfo directory,
	string searchPattern = "*",
	SearchOption searchOption = SearchOption.AllDirectories,
	Action<Exception>? exceptionHandler = null
)

Parameters

directory  DirectoryInfo
The directory to search.
searchPattern  String  (Optional)
The search string to match against the names of files in the directory. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but doesn't support regular expressions.
searchOption  SearchOption  (Optional)
One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory.
exceptionHandler  ActionException  (Optional)
Handles exceptions thrown during file enumeration.

Return Value

FileInfo
An array of the FileInfo objects representing the files in the specified directory that match the specified search pattern, or an empty array if no files are found.

See Also