> ## 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::GetFileSize Method

> IXtfFileIOClient::GetFileSize Method

# IXtfFileIOClient::GetFileSize Method

检索开发主机上指定文件的大小。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
public:
HRESULT GetFileSize(
         LPCWSTR pszFileName,
         PULONGLONG pullFileSize
)  
```

<a id="parametersSection" />

### 参数

*pszFileName*\
类型：LPCWSTR

指向要获取其大小的文件的文件名的指针。

*pullFileSize*\
类型：PULONGLONG

接收指定文件大小（以字节为单位）的指针。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数获取开发主机上指定文件的大小（以字节为单位）。如果发生错误，此函数将返回 HRESULT 错误代码。有关特定于 XBOX 工具框架 (XTF) API 的 HRESULT 错误代码的详细信息，请参阅 [XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)。

你还可以使用 [IXtfFileIOClient::GetFileInfo](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileinfo-ixtffileioclient-xtffileio-xbox-microsoft-m) 方法获取包含开发主机上指定文件信息的 [XTFFILEINFO](/reference/tools/xtf/xtffileio/structures/xtffileinfo-xtffileio-xbox-microsoft-t) 结构，这些信息包括名称、文件属性、创建时间、上次访问时间、上次写入时间和大小。

<a id="requirementsSection" />

## 要求

**头文件：** xtffileio.h

**库：** xtffileio.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

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


## Related topics

- [IXtfFileIOClient::GetFileInfo Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileinfo-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileAttributes Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::CopyFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::FindFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/findfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
