creat(2)

creat2

Create a new file

Usage

#include <fcntl.h>

int

creat(const char *path, mode_t mode);

Library

Standard C Library (libc, -lc)

Overview

This interface is made obsolete by: open(2).

The creat() function is the same as:

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

Releases

155 releases since Mac OS X 10.2; the text changed 2 times.

  1. 10.2–10.2.8
  2. 10.3–10.6.8
  3. 10.7–26.5

History

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

From Libc 1752.120.2 in macOS 26.5. Parsed by carta from the page's mdoc source.