---
name: "creat"
section: "2"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/creat"
---

# creat(2)

create a new file

## NAME

**creat** – create a new file

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

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

*int*\

**creat**(*const char \*path*, *mode\_t mode*);

## DESCRIPTION

This interface is made obsolete by: [open(2)](/open/2.md).

The **creat**() function is the same as:

```
open(path, O_CREAT | O_TRUNC | O_WRONLY, mode);
```

## SEE ALSO

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

## HISTORY

The **creat**() function appeared in Version 1 AT&T UNIX.
