---
title: 句柄转换
description: - 将C句柄转换为Fortran句柄。
url: "https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/userg_hyperio_0030.html"
---

# 句柄转换

#### 函数定义

- 将C句柄转换为Fortran句柄。
  MPI_File_c2f(MPI_File file)

  PMPI_File_c2f(MPI_File file)

- 将Fortran句柄转换为C句柄。
  MPI_File_f2c(MPI_Fint file)

  PMPI_File_f2c(MPI_Fint file)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| file | c/fortran格式句柄 | 非负 | 输入 |


#### 返回值

- 成功：返回Fortarn/c格式句柄。
- 失败：返回NULL。


#### 注意

MPI_File_c2f与MPI_File_f2c仅转换文件句柄。
