---
name: "rfio_fopen"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/rfio_fopen"
---

# rfio\_fopen(3)

opens a file

## NAME

rfio\_fopen - opens a file

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**FILE \*rfio\_fopen (char \****path***, char \****mode***);**\

Under Linux, for large files:\
 **#define \_LARGEFILE64\_SOURCE**\
 **#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**FILE \*rfio\_fopen64 (char \****path***, char** *\*mode***);**

For large files, under other systems:\
 **#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**FILE \*rfio\_fopen64 (char \****path***, char** *\*mode***);**

## DESCRIPTION

**rfio\_fopen** opens the file whose name is the string pointed to by **path** , a character string containing the filename specification, and associates a FILE stream with it.

**mode** is an access mode indicator. One of the characters "r" or "w".

**rfio\_fopen64** allows to open large files (see NOTES).

## RETURN VALUE

This routine returns NULL if the operation failed or a non-NULL pointer to a FILE structure if the operation was successful. If it fails, **serrno** variable is set appropriately.

## ERRORS

- **ENOENT**

  The named file/directory does not exist or is a null pathname.

- **EACCES**

  Search permission is denied on a component of the *path* prefix.

- **EFAULT**

  path is NULL

- **ENOTDIR**

  A component of *path* prefix is not a directory.

- **EINVAL**

  The mode provided to local open is invalid (see [**fopen**(3)](/fopen/3.md))

- **EMFILE**

  Too many open files

- **ECONNRESET**

  Connection reset by peer

- **ETIMEDOUT**

  Connection timed out

- **ECONNREFUSED**

  Connection refused

- **EHOSTUNREACH**

  No route to host

- **SENOSHOST**

  Host unknown.

- **SENOSSERV**

  Service unknown.

- **SEBADVERSION**

  Version ID mismatch

- **SECOMERR**

  Communication error.

- **SERTYEXHAUST**

  Retry count exhausted

- **SENORCODE**

  Host did not return error number

- **SEHOSTREFUSED**

  Host is not on local network and no mapping found

## NOTES

On Irix, Tru64 and IA64 the 64 bit mode is the default one, rfio\_fopen and rfio\_fopen64 are identical.

## SEE ALSO

**[fopen(3)](/fopen/3.md)**, **[rfio\_serror(3)](/rfio_serror/3.md)**, **[rfio\_perror(3)](/rfio_perror/3.md)**, **[serrno(3)](/serrno/3.md)**

## AUTHOR

**LCG Grid Deployment** Team
