Skip to main content

WdDeleteSearchOptions

Specifies file and directory filter patterns for a delete operation. Introduced in: RIT 0.0.13-preview.

Syntax

Members

includeFilePattern
Type: 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. excludeFilePattern
Type: 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. excludeDirPattern
Type: 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. includeFileAttributes
Type: 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. excludeFileAttributes
Type: 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. includeDirAttributes
Type: 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. excludeDirAttributes
Type: 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:
Delete everything except a save data directory:
Delete archived files, but preserve read-only files and hidden directories:
[!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 the searchOptions 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.

Requirements

See also

Last modified on September 29, 2026