int creat(const char *pathname, mode_t mode);
int creat64(const char *pathname, mode_t mode);
is equivalent to:
open(pathname, O_WRONLY | O_CREAT | O_TRUNC, mode);
If the file exists, the length is truncated to 0 and the mode and owner are unchanged.
If the file does not exist, the file's owner ID is set to the effective
user ID of the process. The group ID of the file is set to the effective group
ID of the process. The access permission bits of the file mode
are set to the value of mode, with all bits set in the
process's file mode creation mask cleared (see
On success, a write-only file
descriptor is returned and the file is open for writing, even if
the mode does not permit writing. The file pointer is set to the
beginning of the file. The file descriptor is set to remain open
Points to the path name of the file to create.
Specifies the permission modes associated with the created file.
Search permission is denied on a component of the pathname prefix. Or the file does not exist and the directory in which the file is to be created does not permit writing. Or the file exists and write permission is denied.
The file exists and write permission is denied.
pathname points outside the allocated address space of the process.
A signal interrupted the call.
The named file is an existing directory.
The process has too many open files.
The length of the path name parameter exceeds PATH_MAX or the length of a path name component exceeds NAME_MAX.
The system file table is full.
A component of the pathname prefix does not exist, or pathname is null.
A component of the path name prefix is not a directory.
The named file resides or would reside on a read-only file system.
POSIX.1 (1996), with exceptions.
Refer to Security and File Management in the Windows Concepts chapter of the PTC MKS Toolkit UNIX to Windows Porting Guide for a detailed discussion of file security and file handling issues.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.1 patch 1 Documentation Build 2.