import struct


def read_data(f):
    """
    Reads the integer tokens from a binary file
    saved on disk.

    Parameters
    ----------
    f : str
        Path to the binary file
    Returns
    -------
    integer_tokens : list
        List of integer tokens
    """
    integer_tokens = []

    with open(f, 'rb') as bf:
        while True:
            # Not sure if we want to read 8 bytes for every system
            data = bf.read(8)
            if not data: break
            s = struct.unpack('q', data)
            integer_tokens.append(s[0])

    return integer_tokens