Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sshfs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading