|
FilePathIsFilePatternMatch(String, String, Boolean) Method
|
Determines whether the specified file name matches any of the given file specs (wildcards are defined as '*' or '?' characters).
Namespace: GSF.IOAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.248-beta+a497a19de709fd99e2448886199a2c8824265ddf
Syntaxpublic static bool IsFilePatternMatch(
string[] fileSpecs,
string filePath,
bool ignoreCase
)
Public Shared Function IsFilePatternMatch (
fileSpecs As String(),
filePath As String,
ignoreCase As Boolean
) As Boolean
public:
static bool IsFilePatternMatch(
array<String^>^ fileSpecs,
String^ filePath,
bool ignoreCase
)
static member IsFilePatternMatch :
fileSpecs : string[] *
filePath : string *
ignoreCase : bool -> bool
GSF.IO.FilePath.IsFilePatternMatch = function(fileSpecs, filePath, ignoreCase);
View SourceParameters
- fileSpecs String
- The file specs used for matching the specified file name.
- filePath String
- The file path to be tested against the specified file specs for a match.
- ignoreCase Boolean
- true to specify a case-insensitive match; otherwise false.
Return Value
Booleantrue if the specified file name matches any of the given file specs; otherwise
false.
ExceptionsException | Condition |
---|
ArgumentException | filePath contains one or more of the invalid characters defined in GetInvalidPathChars. |
Remarks
The syntax for
fileSpecs adheres to the following rules:
- Either '\' or '/' (as defined by DirectorySeparatorChar and AltDirectorySeparatorChar) can match the other.
- A single '\' or '/' at the beginning of the pattern matches any valid path root (such as "C:\" or "\\server\share").
- A '?' matches a single character which would be valid in a file name (as defined by GetInvalidFileNameChars).
- A '*' matches any number of characters which would be valid in a file name.
- A sequence of "**\" or "**/" matches any number of sequential directories.
- Any other character matches itself.
See Also