import json


def validate_file(file_name):
    """File validation.

    Create/Open File, return list of dicts
    """
    try:
        with open(file_name,'r'):
            print('-- Opening file... \'' + file_name + '\'!!')
        with open(file_name,'r') as fread:
            all_events = json.load(fread)
        return all_events
    except IOError:
        print('-- File does not exist...')
        print('-- Creating and using file \'' + file_name + '\'!')
        temp = []
        with open(file_name,'w') as fwrite:
            json.dump(temp, fwrite)
        return temp