watch this The wheels are turning, slowly turning. home
How Not To Make A Page-Atomic Copy Of A File 2005-06-16

Can you find the hidden bug?

import os

def copy(fIn, fOut):
    blockSize = os.statvfs(fIn.name).f_bsize
    while 1:
        bytes = fIn.read(blockSize)
        if not bytes:
            break
        fOut.write(bytes)