mcDBopenFileBuffered — Open MemCom database
#include <memcom.h> int mcDBopenFileBuffered(const char* name, char* mode, mcSize npage, mcSize lpage);
mcDBopenFileBuffered
opens a
MemCom database in buffered (paged)
input/output mode. The database remains in the
MemCom environment by the associated
handle until it is closed by mcDBcloseFile
or
until mcExit
is called. The database will be
opened according to the access code mode
(see
below). By default MemCom creates a file
with write permission for 'owner' and with read permissions for
'group' and for 'others'.
The function returns the database handle in the form of a positive integer or the error status if the return value is less than 0.
name
Database name (input). If name
is
of the format hostname:port:path
, a
connection to the MemCom server
at hostname
listening on TCP port
port
is established, and the remote
database path
(which is relative to the
working directory of the server) is opened. In this case,
the npage
and lpage
arguments are ignored.
ftype
Database access mode specified 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', meaning that the function
will fail if o
has been specified and if
the database does not exist. n
means
'new', meaning that the function will fail if
n
has been specified and the database
already exists. s
means scratch, i.e the
database will be deleted when closing. Note that
n
and s
imply
w
.
npage
Number of pages to be assigned to buffer (input).
lpage
Size of a page in bytes (input).