c语言读取hdf文件,HDF文件的基本操作

HDF文件的基本操作

1、打开HDF文件

相关函数: hid_t H5Fopen( const char

*name, unsigned flags, hid_t fapl_id )

作  用:打开一个已经存在的HDF文件 (Opens an

existing HDF5 file. )

返 回 值

:成功则返回一个文件ID,失败则返回一个负值。(Returns a file identifier if successful;

otherwise returns a negative value. )

参  数:

const char *name

被打开文件的名称。(IN: Name of the file

to be opened.)

unsigned flags

存储标志:H5F_ACC_RDWR、H5F_ACC_RDONLY

IN: File access flags.

Allowable values are:

H5F_ACC_RDWR

Allow read and write access to

file.

H5F_ACC_RDONLY

Allow read-only access to

file.

H5F_ACC_RDWR and H5F_ACC_RDONLY

are mutually exclusive; use exactly one.

An additional flag,

H5F_ACC_DEBUG, prints debug information. This flag can be combined

with one of the above values using the bit-wise OR operator (`|'),

but it is used only by HDF5 Library developers; it is neither

tested nor supported for use in applications.

hid_t fapl_idIN: Identifier for

the file access properties list. If parallel file access is

desired, this is a collective call according to the communicator

stored in the fapl_id. Use H5P_DEFAULT for default file access

properties.

2、创建HDF文件

相关函数: hid_t H5Fcreate( const

char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id

)

作  用:创建一个HDF文件 (Opens an existing

HDF5 file. )

返 回 值

:成功则返回一个文件ID,失败则返回一个负值。(Returns a file identifier if successful;

otherwise returns a negative value. )

参  数:

const char *name

需要创建的文件名称。(IN: Name of the file

to access.)

unsigned flags

存储标志:H5F_ACC_TRUNC、H5F_ACC_EXCL、

IN: File access flags.

Allowable values are:

* H5F_ACC_TRUNCTruncate file,

if it already exists, erasing all data previously stored in the

file.H5F_ACC_EXCLFail if file already exists.

* H5F_ACC_TRUNC and

H5F_ACC_EXCL are mutually exclusive; use exactly one.

* An additional flag,

H5F_ACC_DEBUG, prints debug information. This flag can be combined

with one of the above values using the bit-wise OR operator (`|'),

but it is used only by HDF5 Library developers; it is neither

tested nor supported for use in applications.

hid_t fcpl_id

H5P_DEFAULT

IN: File creation property list

identifier, used when modifying default file meta-data. Use

H5P_DEFAULT to specify default file creation

properties.

hid_t fapl_id

H5P_DEFAULT

IN: File access property list

identifier. If parallel file access is desired, this is a

collective call according to the communicator stored in the

fapl_id. Use H5P_DEFAULT for default file access

properties.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值