.th open IV 4/21/86
.sh NAME
open - open for reading or writing
.sh SYNOPSIS
open(name, mode)
.br
char *name;
int mode;
.ft R
.sh DESCRIPTION
Open opens the file name for reading (if mode is 0), writing (if mode
is 1) or for both reading and writing (if mode is 2).  The file can be
opened for exclusive read (if the mode is 4), exclusive write (if the
mode is 5) and exclusive read/write (if the mode is 6).  Name is the
address of a string of ASCII characters representing a path name,
terminated by a null character.
.s3
The returned file descriptor should be saved for subsequent calls to
read, write, and close.
.sh "SEE ALSO"
creat (IV), read (IV), write (IV), close (IV)
.sh DIAGNOSTICS
The error bit (c-bit) is set if the file does not exist, if one of the
necessary directories does not exist or is unreadable, if the file is
not readable (resp.  writable), or if too many files are open.  From C,
a -1 value is returned on an error.

