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

Function copy2

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

Copy data and metadata. Return the file's destination. Metadata is copied with copystat(). Please see the copystat function for more information. The destination may be a directory. If follow_symlinks is false, symlinks won't be followed. This resembles GNU's "cp -P sr

(src, dst, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

433 return dst
434
435def copy2(src, dst, *, follow_symlinks=True):
436 """Copy data and metadata. Return the file's destination.
437
438 Metadata is copied with copystat(). Please see the copystat function
439 for more information.
440
441 The destination may be a directory.
442
443 If follow_symlinks is false, symlinks won't be followed. This
444 resembles GNU's "cp -P src dst".
445 """
446 if os.path.isdir(dst):
447 dst = os.path.join(dst, os.path.basename(src))
448 copyfile(src, dst, follow_symlinks=follow_symlinks)
449 copystat(src, dst, follow_symlinks=follow_symlinks)
450 return dst
451
452def ignore_patterns(*patterns):
453 """Function that can be used as copytree() ignore parameter.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected