def syncfile(src, dst):
    """Same as cp() but only do copying when source file is newer than target file"""
    
    if not os.path.isfile(src):
        raise Exception("No such file: %s" % src)
    
    try:
        dst_mtime = os.path.getmtime(dst)
        src_mtime = os.path.getmtime(src)
        
        # Only accecpt equal modification time as equal as copyFile()
        # syncs over the mtime from the source.
        if src_mtime == dst_mtime:
            return False
        
    except __HOLE__:
        # destination file does not exist, so mtime check fails
        pass
        
    return cp(src, dst)
dataset/ETHPy150Open zynga/jasy/jasy/core/File.py/syncfile