def link_or_copy(src, dst):
    # Links if possible, but we're across devices, we need to copy.
    try:
        os.link(src, dst)
    except OSError, e:
        if e.errno == 18:
            # Across-device linking is not possible. Let's copy.
            shutil.copyfile(src, dst)
        else:
            raise e
link_or_copy(src:str, dst:str) -> None
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/core/system/linux.py/link_or_copy