|
FilePathEnumerateFiles(String, String, SearchOption, ActionException) Method
|
Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories.
Namespace: GSF.IOAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.248-beta+a497a19de709fd99e2448886199a2c8824265ddf
Syntaxpublic static IEnumerable<string> EnumerateFiles(
string path,
string searchPattern = "*",
SearchOption searchOption = SearchOption.AllDirectories,
Action<Exception> exceptionHandler = null
)
Public Shared Function EnumerateFiles (
path As String,
Optional searchPattern As String = "*",
Optional searchOption As SearchOption = SearchOption.AllDirectories,
Optional exceptionHandler As Action(Of Exception) = Nothing
) As IEnumerable(Of String)
public:
static IEnumerable<String^>^ EnumerateFiles(
String^ path,
String^ searchPattern = L"*",
SearchOption searchOption = SearchOption::AllDirectories,
Action<Exception^>^ exceptionHandler = nullptr
)
static member EnumerateFiles :
path : string *
?searchPattern : string *
?searchOption : SearchOption *
?exceptionHandler : Action<Exception>
(* Defaults:
let _searchPattern = defaultArg searchPattern "*"
let _searchOption = defaultArg searchOption SearchOption.AllDirectories
let _exceptionHandler = defaultArg exceptionHandler null
*)
-> IEnumerable<string>
GSF.IO.FilePath.EnumerateFiles = function(path, searchPattern, searchOption, exceptionHandler);
View SourceParameters
- path String
- The relative or absolute path to the directory to search. This string is not case-sensitive.
- searchPattern String (Optional)
- The search string to match against the names of files in path. 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 only the current directory or should include all subdirectories.
- exceptionHandler ActionException (Optional)
- Handles exceptions thrown during file enumeration.
Return Value
IEnumerableStringAn enumerable collection of the full names (including paths) for the files in the directory specified by
path and that match the specified search pattern and option.
See Also