def get_file_data(path):
    """
    read data from a given file
    :param path: file path
    :return: file data
    """
    data = ""
    try:
        _file = open(path, 'r')
        data = _file.read()
        _file.close()
    except EnvironmentError as e:
        print("File operation failed, Error: %s" % e)
        exit(-1)
    return data