In practice, dbz is more restricted than dbm . Dbminit opens a database, an index into the base file base , consisting of files base .dir and base .pag which must already exist.
Subsequent accesses go to that database until dbmclose is called to close the database.
The base file need not exist at the time of the dbminit , but it must exist before accesses are attempted. Fetch searches the database for the specified key , returning the corresponding value if any. Store stores the key - value pair in the database. Store will fail unless the database files are writeable. See below for a complication arising from case mapping.