RTEMS Logo

RTEMS 4.10.0 On-Line Library


Files and Directories Manager creat - Create a new file or rewrite an existing one

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

4.4.11: creat - Create a new file or rewrite an existing one

CALLING SEQUENCE:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int creat(
  const char *path,
  mode_t      mode
);

STATUS CODES:

EEXIST
path already exists and O_CREAT and O_EXCL were used.
EISDIR
path refers to a directory and the access requested involved writing
ETXTBSY
path refers to an executable image which is currently being executed and write access was requested
EFAULT
path points outside your accessible address space
EACCES
The requested access to the file is not allowed, or one of the directories in path did not allow search (execute) permission.
ENAMETOOLONG
path was too long.
ENOENT
A directory component in path does not exist or is a dangling symbolic link.
ENOTDIR
A component used as a directory in path is not, in fact, a directory.
EMFILE
The process alreadyh has the maximum number of files open.
ENFILE
The limit on the total number of files open on the system has been reached.
ENOMEM
Insufficient kernel memory was available.
EROFS
path refers to a file on a read-only filesystem and write access was requested

DESCRIPTION:

creat attempts to create a file and return a file descriptor for use in read, write, etc.

NOTES:

NONE

The routine is implemented in Cygnus newlib.


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2008 OAR Corporation