opendb, opbudb — Open database
#include "memcom.ins" subroutine opdidb(handle,fname,iopen,pw,status) integer*4 handle character*(*) fname integer*4 iopen character*(*) pw integer*4 status subroutine opbudb(handle,fname,iopen,pw,lbuf,lpage,status) integer*4 handle character*(*) fname integer*4 iopen character*(*) pw integer*4 lbuf integer*4 lpage integer*4 status
opdidb
and opbudb
open a database for access by the current process. The file remains
in the MemCom environment by the
associated file number until a call to enddb
or
endadb
is issued. Notice that file handle
numbers are independent of Fortran file unit numbers.
opdidb
opens the file in direct mode, and
opbudb
opens the file in buffered mode (see
introduction to the DB system).
handle
Database handle (input). The file handle
handle
must be in the range of 1 to the
maximum number of
simultaneously open databases and it may not exceed the
maximum number of
simultaneously open databases.
fname
File name (input). The string may not exceed the maximum file name size.
iopen
File open code (input). iopen
takes
the following values defined in
memcom.ins
: MCORWUN
opens the file for reading and writing (if the file exists
it is opened, if not, a new file is created).
MCORWOLD
opens the file for reading and
writing (if the file exists it is opened, if not, an error
is reported). MCORWNEW
opens a new file
for reading and writing (if the file exists an error is
reported). MCORWSCR
opens a temporary
(scratch) file for reading and writing, the file being
deleted after the close operation. MCORDO
opens the file for reading only (if the file does not exist
an error is reported).
pw
Dummy variable (input). Must be specified as blank string of the form ' '.
lbuf
Paged input/output buffer size counted in integer*4 words (input). Buffered mode only.
lpage
Paged input/output page size counted in integer*4 words (input). See Chapter 1 for detailed explanations. Buffered mode only.
status
Status code returned (output). Upon successful completion of the operation, the status value 0 is returned. A negative value is returned, if an error has been detected. A positive value is returned, if a warning has been issued. See MemCom error codes.
Open a new database on file handle (unit) 3 in unbuffered (direct) mode. The file name corresponds to UNIX syntax. Default values for the number of tables as well as the number of entries per table are assumed.
#include "memcom.ins" call opdidb(3,'test.mc',MCORWNEW,' ',status) if(status.lt.0) stop