first previous next last contents

open_db

#include <IO.h>

GapIO *open_db(
        char   *project,
        char   *version,
        int    *status,
        int     create,
        int     read_only);

open_db opens existing databases or creates new databases. The database to be opened or created has unix filenames of "project.version" and "project.version.aux".

The create variable should be 0 or 1. A value of 1 indicates that this database is to be created. This will not be done if there is a file named "project.version.BUSY", in which case the status variable is set to contain IO_READ_ONLY.

The read_only variable should be 0 or 1. A value of 1 indicates that the database should be opened in read only mode, otherwise read/write access is desired. If the database is busy then the database may still be opened in read only mode instead. In this case the status variable is set to contain IO_READ_ONLY.

The GapIO structure is then initialised and returned. A successful return will leave status containing 0. For failure, the function returns NULL.


first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.
URL: http://www.mrc-lmb.cam.ac.uk/pubseq/manual/scripting_132.html