> ## 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.

# IDStorageFileX::Close

> IDStorageFileX::Close

# IDStorageFileX::Close

关闭文件。

## Syntax

```cpp theme={null}
void Close(  
)  
```

### Parameters

此方法无参数。

### Return value

类型：void

## Remarks

此方法显式关闭文件，与对应的 `IDStorageFileX` 对象的引用计数无关。

当对应 `IDStorageFileX` 对象的最后一个引用被释放时，文件会被隐式关闭。

无论是显式关闭还是隐式关闭文件，都会阻塞直到所有尚未完成的 I/O 操作全部结束。

在 `IDStorageFileX` 对象被关闭后，就不能再在 DirectStorage 请求中使用它。

有关详细信息，请参阅 [DirectStorage 概述](/build/console-features/storage/directstorage/directstorage-overview) 中的“IDStorageFileX”一节。

## Requirements

**头文件：** dstorage\_xs.h

**库：** dstorage\_xs.lib

**受支持的平台：** XBOX Series 主机

## See also

[IDStorageFactoryX::OpenFile](/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile)\
[IDStorageFileX](/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex)


## Related topics

- [IDStorageFileX](/zh-CN/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)
- [IDStorageFactoryX::OpenFile](/zh-CN/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile.md)
- [IDStorageFileX::GetHandle](/zh-CN/reference/system/dstorage/interfaces/IDStorageFileX/methods/idstoragefilex_gethandle.md)
- [DirectStorage 概述](/zh-CN/build/console-features/storage/directstorage/directstorage-overview.md)
- [DStorage](/zh-CN/reference/system/dstorage/dstorage_members.md)
