mcf_db_open — Open MemCom database file (Fortran API)
subroutine mcf_db_open(name,mode,handle) subroutine mcf_db_open_paged(name,mode, npage,lpage,handle) character*n name integer*4 mode mcf_size npage mcf_size lpage integer*4 handle
The mcf_db_open
functions open a MemCom
database file for access by the current process.
mcf_db_open
opens the file in direct mode, and
mcf_db_open_buffered
opens the file in paged
mode. The file remains in the MemCom
environment until a call to mcf_db_close
is
issued. Note that file handle numbers are independent of Fortran
file unit numbers. The maximum number of simultaneously open
database files is listed in the Appendix.
name
File name of MemCom file to be opened (input). The
string may not exceed the maximum file name size. If
name
is of the format
hostname:portnum:pathname
, a
connection to the MemCom server
running on the host hostname
listening on TCP port portnum
is
established, and the remote database
pathname
(which is relative to
the working directory of the server) is opened. In case of a
remote database, the npage
and
lpage
arguments are ignored.
mode
File open mode in the form of a concatenated string
(input). r
means read only
(default setting). w
means write
only. rw
means read and write.
o
means old file, meaning that
the function will fail if o has been specified and if the
file does not exist. n
means new
file, meaning that the function will fail if
n
has been specified and the file
already exists. s
means scratch
file, i.e the database will be deleted when closing. Note
that n
and
s
imply
w
.
lbuf
Paged input/output buffer size in words (input). Buffered mode only.
lpage
Paged input/output page size in words (input). See Chapter 1 for detailed explanations. Buffered mode only.
handle
MemCom file handle returned by the function. Upon successful completion of the operation, a value greater or equal to zero is returned. A negative value is returned, if an error has been detected. A positive value is returned, if a warning has been issued.