Creates a new file, or if the specified file exists, recreates it as an empty file.
#include <fcntl.h> int creat ( const char *path, mode_t mode);
(IN) Points to the name of the file to create.
(IN) Specifies the file access permissions (see File Access Modes and NetWare Attributes).
If successful, returns a file descriptor, which is a non-negative integer, and opens the file in a O_WRONLY mode. If an error occurs, returns -1 and sets errno to one of the following values:
The path parameter supplies the name of the file to be created:
If the file exists, it is truncated to contain no data and the preceding permission setting is unchanged.
If the file does not exist, it is created with access permission given by the mode parameter.
If the creat function is successful, the file is opened exclusively for writing and never for reading and writing.