Reads data from <fin> and writes it to <fout> until EOF is
        reached.

def pump(fin, fout):
    """ Reads data from <fin> and writes it to <fout> until EOF is
        reached. """
    while True:
        tmp = fin.read(4096)
        if not tmp:
            break
        fout.write(tmp)