Add methods like PathBase.copy() and copytree() that support copying files and directories from one path object to another.
PathBase.copy() should:
Call open() methods on the source and destination to transfer data
Attempt to copy permissions with stat() and chmod(), but suppress UnsupportedOperation
Copy symlinks with is_symlink(), readlink() and symlink_to() if the user sets follow_symlinks=False (and if they fail with UnsupportedOperation, copy the symlink contents?)
PathBase.copytree() should:
Call walk() to iterate over the source
Call mkdir() to create directories, but suppress UnsupportedOperation
Call copy() to copy files
Implementations in Path should use shutil when a os.PathLike argument is given, and call super() otherwise.
Add methods like
PathBase.copy()
andcopytree()
that support copying files and directories from one path object to another.PathBase.copy()
should:open()
methods on the source and destination to transfer datastat()
andchmod()
, but suppressUnsupportedOperation
is_symlink()
,readlink()
andsymlink_to()
if the user setsfollow_symlinks=False
(and if they fail withUnsupportedOperation
, copy the symlink contents?)PathBase.copytree()
should:walk()
to iterate over the sourcemkdir()
to create directories, but suppressUnsupportedOperation
copy()
to copy filesImplementations in
Path
should useshutil
when aos.PathLike
argument is given, and callsuper()
otherwise.