> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IXtfFileIOClient::FindFiles Method

> IXtfFileIOClient::FindFiles Method

# IXtfFileIOClient::FindFiles Method

Searches for files on a development console.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT FindFiles(
         LPCWSTR pszSearchPattern,
         DWORD dwIncludeAttributes,
         DWORD dwExcludeAttributes,
         DWORD dwRecursionLevels,
         DWORD dwFlags,
         IXtfFindFileCallback *pCallback
)  
```

<a id="ID4EH" />

### Parameters

*pszSearchPattern*\
Type: LPCWSTR

Pointer to the search pattern that defines the filenames of the source files to search for.\
This parameter accepts wildcard characters to match strings with the indicated pattern.

*dwIncludeAttributes*\
Type: DWORD

Bitwise-OR combination of file attributes to include for the search. See [File Attribute Constants](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx) for a list of possible attributes.

*dwExcludeAttributes*\
Type: DWORD

Bitwise-OR combination of file attributes to exclude from the search. See [File Attribute Constants](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx) for a list of possible attributes.

*dwRecursionLevels*\
Type: DWORD

Number of directory levels to recurse for the search.

*dwFlags*\
Type: DWORD

Bitwise-OR combination of flags that specify how to search for the files.

*pCallback*\
Type: IXtfFindFileCallback \*

Pointer to the [IXtfFindFileCallback](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t) callback to call when files are found.

<a id="ID4EQ" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="requirements" />

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

**Supported platforms:** Windows (for XBOX console tools)

<a id="ID4EZB" />

## Remarks

When finding files *dwIncludeAttributes* and *dwExcludeAttributes* act as filters on which files are returned, it does not act as a filter on which file attributes are returned when finding files. The [IXtfFindFileCallback's](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t) **onfindfile** function call will be called for each file being returned. The callback function will return information about each file found. The returned information can be used to return progress information.

## See also

<a id="ID4E2B" />

[IXtfFileIOClient Interface](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/ixtffileioclient-xtffileio-xbox-microsoft-t)\
[XtfFileIO](/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n)\
[IXtfFindFileCallback](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t)


## Related topics

- [IXtfFindFileCallback::OnFoundFile Method](/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/methods/onfoundfile-ixtffindfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::SetFileAttributes Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/setfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::RemoveDirectory Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/removedirectory-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::CopyFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
