creat man page on NeXTSTEP

Man page or keyword search:  
man Server   1419 pages
apropos Keyword Search (all sections)
Output format
NeXTSTEP logo
[printable version]


CREAT(2)							      CREAT(2)

NAME
       creat - create a new file or rewrite an existing one

SYNOPSIS
       #include <sys/file.h>
       #include <sys/stat.h>
       #include <fcntl.h>

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

DESCRIPTION
       The  creat  function  creates  a	 new  file  or	prepares to rewrite an
       existing file whose pathname is given by path.  If  the	file  did  not
       exist  previously, then the file is created with permission bits set to
       the value of the mode argument, modified by  the	 process's  mode  mask
       (see  umask(2)).	  Also	see  chmod(2) for the construction of the mode
       argument.

       The created file is opened for writing,	and  its  file	descriptor  is
       returned.   If  the  file  already  existed,  its mode and owner remain
       unchanged but it is truncated to zero length.

       The function call:

	      creat(path, mode);

       is equivalent to:

	      open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);

RETURN VALUE
       Upon  successful	 completion,  creat  returns  a	 nonnegative   integer
       representing  the  lowest  numbered unused file descriptor.  Otherwise,
       the function returns -1 and sets errno to indicate the error.

ERRORS
       See open(2) for possible error conditions and errno values.

SEE ALSO
       chmod(2), close(2), open(2), umask(2), write(2)

4th Berkeley Distribution	August 1, 1992			      CREAT(2)
[top]

List of man pages available for NeXTSTEP

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net