isopen(S) 6 January 1993 isopen(S) Name isopen - open an ISAM file Syntax cc . . . -lisam isopen(filename, mode) char *filename; int mode; Description The isopen function opens a data file for processing. The call returns the file descriptor that is to be used by subsequent ISAM calls on that file. Use the isclose function to close the file. You can use the following arguments with this routine: _________________________________________________________________________ Argument Description _________________________________________________________________________ filename Null-terminated character string identi- fying the name of the ISAM file to be opened. mode are described below. The current index is set to the primary key. The current record pointer is set to the first record in the file based on the order in the primary index. It can be set to the first record in another index by using the isstart function. The mode parameter specifies the lock mode and the read/write mode in effect while the file is open. The value of the mode parameter is the arithmetic sum of a lock mode value and a read/write mode value. The lock mode values are defined in isam.h as: _________________________________________________________________________ Lock Mode Description _________________________________________________________________________ ISAUTOLOCK automatic record lock ISMANULOCK manual record lock ISEXCLLOCK exclusive isam file lock ISSHARLOCK shared isam file lock These modes have the following effects: + When ISAUTOLOCK is used, each record is locked when it is read, and unlocked after the next function call is made. + When ISMANULOCK is used, the user must manually lock and unlock each record to perform any operation on that record. A record can be locked by using the ISLOCK mode in the isread function call, and unlocked with the isrelease function call. + When ISEXCLLOCK is used, the entire file is locked. Other users can neither read from nor to the file. The file is automatically unlocked when it is closed with isclose. + When ISSHARLOCK is used, the entire file is locked with a shared lock. Other users can read the file and place shared locks on it but may not change it. The file is automatically unlocked when it is closed with isclose. The read/write mode values are defined in isam.h as: _________________________________________________________________________ Access Modes Description _________________________________________________________________________ ISINPUT open for reading only ISOUTPUT open for writing only ISINOUT open for reading and writing On success, isopen returns a non-negative integer. Otherwise, it returns -1 and sets iserrno to indicate the error. Example isopen( "books", ISAUTOLOCK + ISINOUT ) ; See also isbuild(S), isclose(S) Standards conformance isopen is not part of any currently supported standard; it is an exten- sion of AT&T System V provided by the Santa Cruz Operation.