# mco_disk_flush

> Explicitly flush the file system buffers.

### Prototype

        MCO_RET	mco_disk_flush(	/*IN*/ mco_db_h db );

### Arguments

db | The database handle that was established by `mco_db_connect()`

### Description

> This function allows applications to explicitly flush the file system buffers; it is most often used in conjunction with the `MCO_COMMIT_NOSYNC` Transaction Commit policy.

### Return Codes

MCO_S_OK | File system buffers successfully flushed to disk. (No flush actually occurs if called for a in-memory database.)
MCO_E_DISK_FLUSH | Error flushing buffers to disk
MCO_E_DISK_OPERATION_NOT_ALLOWED | An attempt was made to flush to disk with an active transaction open. This function must be called when the current connection has no active transactions

### 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;

            ...
            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_flush( db );

                ...
            }
        }

### Files

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