open - open for reading or writing
FD open(path, oflag[, mode])
int oflag, mode;
points to a path name naming a file on either the satellite system or
the host system (host path names are preceded with a '!'). Some path
names are reserved to open the local device drivers on the satellite.
A list of possible reserved names (depending on how the satellite is
analog to digital converter
digital to analog converter
smpte time code
high current digital output
digit input and output
16-bit input buffer
See section 4 for a description of the function of these special
opens a file descriptor for the named file and sets the file status
flags according to the value of
values are constructed by ORing flags from the following list:
Choose 1 from the next 3 permission flags.
Open for reading only.
Open for writing only.
Open for reading and writing.
If set, the file pointer will be set to the end of the file before the
If the file exists, this flag has no effect. If
refers to a host file, this file's owner ID is set to the process's
effective user ID, the file's group ID is set to the process's
effective group ID, and the low-order 12 bits of the file mode are set
to the value of
modified by ORing together some combination of the following:
04000 set user ID on execution
02000 set groupo ID on execution
01000 save text image after execution
00400 read by owner
00200 write by owner
00100 execute (search on directory) by owner
00070 read, write, execute (search) by group
00007 read, write, execute (search) by others
refers to a satellite file, only the read/write/execute by owner
If the file exists, its length is truncated to 0 and the mode and
owner are unchanged.
If O_EXCL and O_CREAT are set,
will faile if the file exists.
Upon successful completions a non-negative integer, the file
descriptor, is returned.
The file pointer used to mark the current position within the file is
set to the beginning of the file, unless O_APPEND is set, in which
case the file pointer is set to the end of the file.
No process may have more than 20 host files or 10 satellite files open
simultaneously. Any number of special satellite devices may be open
The named file is opened unless one or more of the following are true:
A component of the path prefix is not a directory. [ENOTDIR]
O_CREAT is not set and the named files does not exist. [ENOENT]
A component of the path prefix denies search permission. [EACCES]
permission is denied for the named file. [EACCES]
The named file is a directory and
is write or read/write. [EISDIR]
The maximum file descriptors are currently open. [ENFILE]
The named file is a character special or block special file, and
the device associated with this special file does not exist. [ENXIO]
O_CREAT and O_EXCL are set, and the named file exists. [EEXIST]
Upon successful completion, a non-negative integer, namely a file
descriptor, is returned. Otherwise, a value of -1 is returned and
is set to indicate the error.