creat \- create a new file
creates a new file or prepares to rewrite an existing
given as the address of a null-terminated string.
If the file did not exist, it is given
as modified by the process's mode mask (see
If the file did exist, its mode and owner remain unchanged
but it is truncated to 0 length.
The file is also opened for writing, and its file descriptor
given is arbitrary; it need not allow
This feature is used by programs which deal with temporary
The creation is done with
a mode that forbids writing.
instance of the program attempts a
returned and the program knows that the name is unusable
write(2), close(2), chmod(2), umask (2)
The value \-1 is returned if:
a needed directory is not searchable;
the file does not exist and the directory
in which it is to be created is not writable; the file
does exist and is unwritable;
there are already too many files open.