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

# FindFiles

> IXtfFileIOClient::FindFiles Method

Searches for files on a development console.

## Syntax

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

### 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](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t.md) callback to call when files are found.

### Return value

Type: HRESULT

HRESULT success or error code.

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

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

## 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](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t.md) **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

[IXtfFileIOClient Interface](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/ixtffileioclient-xtffileio-xbox-microsoft-t.md)\
[XtfFileIO](https://docs.xbox.com/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n.md)\
[IXtfFindFileCallback](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t.md)


## Related topics

- [OnFoundFile](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/methods/onfoundfile-ixtffindfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/ixtffileioclient-xtffileio-xbox-microsoft-t.md)
- [IXtfFindFileCallback Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t.md)
- [DeleteFiles](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [XtfFileIO (API contents)](https://docs.xbox.com/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n.md)
