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

# open\_write(3diet)

open a file for writing

## NAME

open\_write - open a file for writing

## SYNTAX

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

int **open\_write**(const char \**filename*);

## DESCRIPTION

open\_write opens the file *filename* for write-only use and returns the file handle.  If the file does not exist, it will be created with mode 0644.  If there was an error opening or creating the file, open\_write returns -1 and sets errno accordingly.

## SEE ALSO

[open(2)](/open/2.md)
