---
name: "io_readwritefile"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/io_readwritefile/3diet"
---

# io\_readwritefile(3diet)

open a file for reading and writing

## NAME

io\_readfile - open a file for reading and writing

## SYNTAX

**#include \<io.h\>**

int **io\_readwritefile**(int64\* d,const char\* s);

## DESCRIPTION

io\_readwritefile sets d to the number of a new descriptor reading from and writing to the disk file named *s*, and returns 1.  The file needs to exist.

If something goes wrong, io\_readwritefile sets *errno* to indicate the error, and returns 0; it does not create a new descriptor, and it does not touch d.

## SEE ALSO

[io\_readfile(3)](/io_readfile/3.md), [io\_createfile(3)](/io_createfile/3.md), [io\_appendfile(3)](/io_appendfile/3.md)
