---
title: 创建文件
description: "创建HDF5文件。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/userg_hyperio_0083.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/userg_hyperio_0083.html
indexId: 31885e4851415593e2d4c9977bddc8e1501d5b599e58a693445b2c44a5d8e17f64
---
# 创建文件

#### 函数定义

创建HDF5文件。

hid_t H5Fcreate(const char *name, unsigned flags, hid_t createPlistId, hid_t accessPlistId)


#### 参数

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


#### 返回值

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


#### 注意

当flags包含H5F_ACC_TRUNC时，不支持Hyper IO库文件聚合功能。
