mco_disk_load_cache

Load the previously saved state of the disk manager cache.

Prototype

 
    MCO_RET	mco_disk_load_cache(	/*IN*/ mco_db_h db, /*IN*/ char const* file_path );
 

Arguments

db The database handle that was established by mco_db_connect()

file_path

The path to the file where the cache image is saved

Description

This function loads the previously saved state of the Disk Manager cache from persistent media.

Return Codes

MCO_S_OK Cache image successfully saved

MCO_E_DISK_OPEN

Error opening/creating file on persistent storage device

MCO_E_DISK_READ

Error reading from persistent storage device

MCO_E_DISK_CLOSE

Error closing persistent storage device

Example

 
    Application snippet:
        
     
    const char * dbname = "SimpleDb";
     
    int main(int argc, char* argv[])
    {
        mco_db_h db;
        MCO_RET rc;
        mco_device_t       dev[4];
        mco_db_params_t    db_params;
        char * file_path = "c:\temp\backup\cache.sav";
         
        ...
        rc = mco_db_open_dev( dbname, simple_get_dictionary(), dev, 4, &db_params );
             
        if ( MCO_S_OK != rc )
        {
            rc = mco_db_connect(  dbname, &db );
            ...
            rc = mco_disk_load_cache( db, file_path);
        
            ...
        }
    }
 

Files

Header file:
mco.h
Source file:
mcodisk.c
Library:
libmcovtdsk.a
Header file:
mco.h
Source file:
mcovtmem.c
Library:
libmcovtmem.a