WdDeleteSearchOptions
Specifies file and directory filter patterns for a delete operation. Introduced in: RIT 0.0.13-preview.Syntax
Members
includeFilePatternType: const char* Includes files that match the specified names. The wildcard characters
* and ? are supported, and a list of patterns can be separated by a semicolon (;). The default is nullptr, which includes everything.
excludeFilePatternType: const char* Excludes files that match the specified names. The wildcard characters
* and ? are supported, and a list of patterns can be separated by a semicolon (;). The default is nullptr, which excludes no files.
excludeDirPatternType: const char* Excludes directories that match the specified names, not paths. The wildcard characters
* and ? are supported. The default is nullptr, which excludes no directories from being deleted.
includeFileAttributesType: uint64_t Includes files for which any of the specified file attributes are set. The supported values are
FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_SYSTEM, and FILE_ATTRIBUTE_HIDDEN. The default is 0, which includes all attributes. For additional information on file attributes check File Attribute Constants.
excludeFileAttributesType: uint64_t Excludes files for which any of the specified file attributes are set. The supported values are
FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_SYSTEM, and FILE_ATTRIBUTE_HIDDEN. The default is 0, which excludes no attributes. For additional information on file attributes check File Attribute Constants.
includeDirAttributesType: uint64_t Includes directories for which any of the specified file attributes are set. The supported values are
FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_SYSTEM, and FILE_ATTRIBUTE_HIDDEN. The default is 0, which includes all attributes.
excludeDirAttributesType: uint64_t Excludes directories for which any of the specified file attributes are set. The supported values are
FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_SYSTEM, and FILE_ATTRIBUTE_HIDDEN. The default is 0, which excludes no attributes.
Examples
Delete only.pdb and .log files:
[!NOTE]
When there is a conflict between include and exclude patterns, the exclude pattern takes precedence and the item will not be deleted.
Remarks
Pass this structure to WdDeleteRemoteFiles via thesearchOptions parameter to filter which files and directories are selected for deletion. If nullptr is passed for searchOptions, all items are included with no filtering.
These options apply only when remoteFolderPath resolves to a folder. They are ignored when remoteFolderPath resolves to a single file.
A filtered delete that leaves items behind preserves the root folder even when deleteRootFolder is set to true in WdDeleteOptions, because the folder is removed only if it is left empty.
