OPEN(3spp)
NAME
open − open a file for reading or writing
SYNOPSIS
#include <sys/file.h>
open(path, flags)
char *path;
int flags;
DESCRIPTION
Open opens the file path for reading and/or writing, as specified by the flags argument and returns a descriptor for that file.
Path is the address of a string of ASCII characters representing a path name, terminated by a null character. The flags specified are formed by or’ing the following values
O_RDONLYopen for reading only
O_WRONLYopen for writing only
O_RDWRopen for reading and writing
Upon successful completion a non-negative integer termed a file descriptor is returned. The file pointer used to mark the current position within the file is set to the beginning of the file.
The system imposes a limit on the number of file descriptors open simultaneously, currently the limit is 10.