Guardian C Library Calls Reference Manual
ctime
3-22 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
security
specifies the security setting. See the FUP SECURE command description of integer
encoding in the FUP Reference Manual for more information.
pext
specifies the number of pages (2048-byte blocks) in the primary extent; it must be in
the range 1 through 65,535. If you omit pext, then creat uses the value 2.
sext
specifies the number of pages in each of the secondary extents; it must be in the
range 1 through 65,535. If you omit sext, then creat uses the value 16.
Return Value
is the descriptor denoting the file if the operation is successful; otherwise creat
returns the value -1.
Usage Guidelines
•
The creat function creates C binary files (code 180) only. To create an Edit file, use
the open function with the O_TEXT and O_CREAT flags.
•
The creat function ignores security, pext, and sext for files that already exist.
•
Use the creat function only on files that you plan to rewrite completely. Any existing
data is lost.
•
For more information regarding file extents and pages, refer to the ENSCRIBE
Programmer’s Guide.
•
The default number of maxextents for files created by creat is 500.
Example
This example creates a file named $a.b.c:
#include <fcntlh>
int filedes;
filedes = creat("$a.b.c");
ctime
The ctime function converts the calendar time pointed to by timer to local time in the
form of a string.
#include <timeh>
char *ctime(const time_t *timer);