def open_file(filename, create=False):
    """Open the file name.  Return its handle."""
    try:
        return open(filename, 'rb+')
    except FileNotFoundError:
        if create:
            return open(filename, 'wb+')
        raise
