-

Functions HI-TECH C CREAT

From HI-TECH C for CP/M Fan WIKI(EN)
Revision as of 18:46, 31 July 2017 by Kumokosi (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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