UtilFileGetFilePaths(DirectoryInfo, SearchOption, IEnumerableString, IEnumerableString, Boolean, Boolean) Method

Gets the filepaths those matches the criteria inside the specified directory and/or sub-directories.

Definition

Namespace: DevCase.Core.IO.FileSystem
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IEnumerable<string> GetFilePaths(
	DirectoryInfo dir,
	SearchOption searchOption,
	IEnumerable<string> fileNamePatterns = null,
	IEnumerable<string> fileExtPatterns = null,
	bool ignoreCase = true,
	bool throwOnError = false
)

Parameters

dir  DirectoryInfo
The root directory path to search for files.
searchOption  SearchOption
The searching mode.
fileNamePatterns  IEnumerableString  (Optional)
The file name pattern(s) to match.
fileExtPatterns  IEnumerableString  (Optional)
The file extension pattern(s) to match.
ignoreCase  Boolean  (Optional)
If , ignores the comparing case of fileNamePatterns and fileExtPatterns patterns.
throwOnError  Boolean  (Optional)
If set to , exceptions will be thrown, like access denied to file or directory.

Return Value

IEnumerableString
An IEnumerableT instance containing the filepaths.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

Exceptions

ArgumentException dirPath or searchOption

See Also