FilePathIsFilePatternMatch(String, String, Boolean) Method
Determines whether the specified file name matches the given file spec (wild-cards are defined as '*' or '?' characters).
Namespace: Gemstone.IOAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static bool IsFilePatternMatch(
string fileSpec,
string filePath,
bool ignoreCase
)
Public Shared Function IsFilePatternMatch (
fileSpec As String,
filePath As String,
ignoreCase As Boolean
) As Boolean
public:
static bool IsFilePatternMatch(
String^ fileSpec,
String^ filePath,
bool ignoreCase
)
Gemstone.IO.FilePath.IsFilePatternMatch = function(fileSpec, filePath, ignoreCase);
- fileSpec String
- The file spec used for matching the specified file name.
- filePath String
- The file path to be tested against the specified file spec for a match.
- ignoreCase Boolean
- true to specify a case-insensitive match; otherwise false.
Booleantrue if the specified file name matches the given file spec; otherwise
false.
The syntax for
fileSpec 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.
ArgumentException | filePath contains one or more of the invalid characters defined in GetInvalidPathChars. |