diff --git a/sshfs/spec.py b/sshfs/spec.py index 046a6ec..fd7eb93 100644 --- a/sshfs/spec.py +++ b/sshfs/spec.py @@ -203,6 +203,12 @@ async def _get_file( @wrap_exceptions async def _cp_file(self, lpath, rpath, **kwargs): + # some SFTP servers support the copy-data extension + with suppress(SFTPOpUnsupported): + async with self._pool.get() as channel: + await channel.copy(lpath, rpath) + return + cmd = f"cp {shlex.quote(lpath)} {shlex.quote(rpath)}" await self._execute(cmd)