jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
316 stars 73 forks source link

Problem copying smb file #208

Closed lulusmx closed 1 year ago

lulusmx commented 1 year ago

Hello, I have a problem when I want to copy a file from my post to another post in smb. I have this error message although the path is absolutely correct, do you have a solution? capt2

lulusmx commented 1 year ago

Ok I think I understood you can't copy from one host to a different host. Do you have a solution to do this?

jborean93 commented 1 year ago

Using copyfile directly on smbclient is limited to a copy on the same host but you can use smbclient.shutil with copy, copy2, copyfile, copyfileobj which should support copying files between different hosts (including local). Also keep in mind to use r"" strings for all your paths with a backslash in them (or remember to double them up if you don't).