Functions HI-TECH C CREAT

CREAT

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 chmod(), 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 chmod() function.

SEE ALSO

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