{ } Raw JSON

bundles / IPython 9.17.0 / IPython / utils / path / link_or_copy

function

IPython.utils.path:link_or_copy

source: /dev/ipython/IPython/utils/path.py:307

Signature

def link_or_copy(src, dst)

Summary

Attempts to hardlink src to dst, copying if the link fails.

Extended Summary

Attempts to maintain the semantics of shutil.copy.

Because os.link does not overwrite files, a unique temporary file will be used if the target already exists, then that file will be moved into place.

Aliases

  • IPython.utils.path.link_or_copy