---
title: 打开文件
description: "打开现有的HDF5文件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0084.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0084.html
indexId: 41b3e336bd09f96f04f7495f2c56c5f0fde7526d8e7fc0ce54a964462809899058
---
# 打开文件

#### 函数定义

打开现有的HDF5文件。

hid_t H5Fopen(const char *name, unsigned flags, hid_t accessPlistId)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| \*name | 要打开的文件的名称。 | 非空，长度小于256字节 | 输入 |
| flags | 文件访问标志。 | 无符号整数 | 输入 |
| accessPlistId | 文件访问属性列表标识符。 | 整数 | 输入 |


#### 返回值

- 成功：返回文件标识符。
- 失败：返回-1。
