OPEN(2)

NAME
open - open for reading or writing

SYNOPSIS
int open(name, rwmode)
char *name;

DESCRIPTION
Open opens the file name for reading (if rwmode is 0), writing (if rwmode is 1) or for both reading and writing (if rwmode is 2) and returns an associated file descriptor. Name is a null-terminated string representing a path name.

The file pointer is set to 0.

It is not possible to open for writing a file with set-userid or set-groupid permission; see stat(2).

SEE ALSO
close(2), creat(2), dup(2), read(2), write(2)

DIAGNOSTICS
EACCES, EBUSY, ECONC, EFAULT, EINTR, EIO, EISDIR, ELAB, ELOOP, EMFILE, ENFILE, ENOENT, ENOTDIR, EROFS, ETXTBSY

BUGS
It should be possible to open files for writing with exclusive use, and to call open without the necessity of waiting for carrier on communication lines.