-

Changes

Jump to: navigation, search

Functions HI-TECH C CREAT

837 bytes added, 18:46, 31 July 2017
Created page with "<strong>CREAT</strong> ==SYNOPSIS== #include <stat.h> int creat(char * name, int mode) ==DESCRIPTION== This routine attempts to create the file named by name. If the f..."
<strong>CREAT</strong>
==SYNOPSIS==

#include <stat.h>

int creat(char * name, int mode)


==DESCRIPTION==
This routine attempts to create the file named by name.
If the file exists and is writeable, it will be removed
and re-created. The return value is -1 if the create
failed, or a small non-negative number if it succeeded.
This number is a valuable token which must be used to
write to or close the file subsequently. Mode is used
to initialize the attributes of the created file. The
allowable bits are the same as for <strong>chmod</strong>(), but for
Unix compatibility it is recommended that a mode of
0666 or 0600 be used. Under CP/M the mode is ignored -
the only way to set a files attributes is via the
<strong>chmod</strong>() function.

==SEE ALSO==

open, close, read, write, seek, stat, chmod

Navigation menu