# mco_open_flash_media
RT

> Opens a flash media device

### Prototype

        mco_xflash_media_t* mco_open_flash_media(
            mco_db_h con,
            const mco_device_t * storage_dev
        );

### Arguments

storage_dev
The storage device to open
con
The database handle for a database connection

### Description

> This function opens a flash media device

>         ...
>         mco_database_h dbh;
>         ...
>         mco_device_t *storage_dev = MCO_REF2PTR(mco_device_t, dbh, dbh->disk_storage);
>         mco_xflash_media_t* media = mco_open_flash_media(0, storage_dev);
>         if (!media) {
>             MCO_TRACE(MCO_TRACE_WARNING, "Xflash media is null");
>             return MCO_E_DISK_INVALID_PARAM;
>         }
>         ...
>         media->media_close(media);
>         ...

### Return Codes

> This function returns a pointer to the flash media device on success, or NULL on failure.

### Files

Header file:
mco.h
Source file:
mcoflashsim.c
Library:
libmcoflashsim.a