MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / copy

Function copy

tools/python-3.11.9-amd64/Lib/shutil.py:417–433  ·  view source on GitHub ↗

Copy data and mode bits ("cp src dst"). Return the file's destination. The destination may be a directory. If follow_symlinks is false, symlinks won't be followed. This resembles GNU's "cp -P src dst". If source and destination are the same file, a SameFileError will be

(src, dst, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

415 raise
416
417def copy(src, dst, *, follow_symlinks=True):
418 """Copy data and mode bits ("cp src dst"). Return the file's destination.
419
420 The destination may be a directory.
421
422 If follow_symlinks is false, symlinks won't be followed. This
423 resembles GNU's "cp -P src dst".
424
425 If source and destination are the same file, a SameFileError will be
426 raised.
427
428 """
429 if os.path.isdir(dst):
430 dst = os.path.join(dst, os.path.basename(src))
431 copyfile(src, dst, follow_symlinks=follow_symlinks)
432 copymode(src, dst, follow_symlinks=follow_symlinks)
433 return dst
434
435def copy2(src, dst, *, follow_symlinks=True):
436 """Copy data and metadata. Return the file's destination.

Callers

nothing calls this directly

Calls 5

copyfileFunction · 0.85
copymodeFunction · 0.85
basenameMethod · 0.80
isdirMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected