Next Previous Contents

## 3.38 creat

> Function

>   Create a file.

> Header

>   `fcntl.h`

> Declaration

>   `int __fastcall__ creat (const char* name, unsigned mode);`

> Description

>   `creat` creates a new file and returns the file descriptor associated with it. On error, -1 is returned and an error code is stored in `errno`.

> Limits

>   - `creat` is identical to calling `open` with `flags` equal to `O_WRONLY | O_CREAT | O_TRUNC`.
>   - The function is only available as fastcall function, so it may only be used in presence of a prototype.
> Availability

>   POSIX 1003.1

> See also

>   close, open

> Example

>   None.

Next Previous Contents