Adds a path or mask into collection of exclusion patterns. The supported wildcards are '?' and '*' and '**'.
For detailed specification with examples see the documentation.
Namespace:
Rebex.IO
Assembly:
Rebex.Common (in Rebex.Common.dll)
Syntax
Visual Basic |
---|
Public Overridable Sub Exclude ( _ pattern As String, _ mode As TraversalMode _ ) |
C# |
---|
public virtual void Exclude( string pattern, TraversalMode mode ) |
Parameters
- pattern
- Type: System..::..String
A path or mask (relative to the base path) which define an exclusion pattern.
- mode
- Type: Rebex.IO..::..TraversalMode
Specifies traversal mode of directories for the pattern.
Remarks
'?' matches any single character.
'*' matches any number of any characters except the directory separators.
'**' matches any number of any characters (directory separators can be reduced e.g. "a\**\b" is equivalent to "a\**\**\b" which matches "a\x\y\z\b" and also "a\b" but not "ab").
'*' matches any number of any characters except the directory separators.
'**' matches any number of any characters (directory separators can be reduced e.g. "a\**\b" is equivalent to "a\**\**\b" which matches "a\x\y\z\b" and also "a\b" but not "ab").
Examples
data\file-???.txt | Matches files within the "data" directory e.g. "data\file-007.txt", but not "data\file-7.txt". |
data\*.txt | Matches any ".txt" file within the "data" directory (only within the "data" directory, not in subdirectories) e.g. "data\file.txt", but not "data\a\b\c\file.txt". |
data\**\*.txt | Matches any ".txt" file anywhere within the "data" directory and its subdirectories e.g. "data\file.txt" and also "data\a\b\c\file.txt". |