def cdriver2commtype(driver):
    """Convert a connection driver to a file type.

    Args:
        driver (str): The name of the connection driver.

    Returns:
        str: The corresponding file type for the driver.

    """
    _legacy = {'InputDriver': 'default', 'OutputDriver': 'default',
        'ZMQInputDriver': 'zmq', 'ZMQOutputDriver': 'zmq', 'IPCInputDriver':
        'ipc', 'IPCOutputDriver': 'ipc', 'RMQInputDriver': 'rmq',
        'RMQOutputDriver': 'rmq', 'RMQAsyncInputDriver': 'rmq_async',
        'RMQAsyncOutputDriver': 'rmq_async'}
    if driver in _legacy:
        return _legacy[driver]
    raise ValueError("Unknown driver: '%s'" % driver)
