basic.%creat
Creates new Unix file, or rewrites to existing file.
Syntax
file.descriptor=%creat(string, mode)
Description
creates a new ordinary Unix file or prepares to rewrite an existing Unix file designated by 'string' for write only. 'mode' controls the file mode. Valid values of 'mode' are in the include 'mode.h'. Combinations of the modes are obtained by adding several elementary modes together.
Example
include dm,bp,unix.h mode.h
* Create a unique temporary file
* read and write permission for user,
* read for group
fd=%creat( '/tmp/':system(19),
S$IRUSR+S$IWUSR+S$IRGRP)
Note the usage of the plus operator to combine flags, where a regular C program
would have used an 'or'.
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
