def get_name(img, map_name):
    """Returns name of cache file."""
    import os
    if img._pi:
        pi_text = 'pi'
    else:
        pi_text = 'I'
    suffix = '/w%i_%s/' % (img.j, pi_text)
    dir = img.tempdir + suffix
    if not os.path.exists(dir):
        os.makedirs(dir)
    return dir + map_name + '.bin'
