【发布时间】:2014-08-15 13:09:06
【问题描述】:
在我的工作代码中,我有这个
import paramiko
parent=os.path.split(dir_local)[1]
for walker in os.walk(parent):
try:
self.sftp.mkdir(os.path.join(dir_remote,walker))
except:
pass
for file in walker[2]:
sftp.put(os.path.join(walker[0],file),os.path.join(dir_remote,walker[0],file))
现在显示的错误是
Trying ssh-agent key 5e08bb83615bcc303ca84abe561ef0a6 ... success
Caught exception: <type 'exceptions.IOError'>: [Errno 2] Directory does not exist.
打印walker 显示该文件夹内的所有文件,但我不知道为什么该文件夹不复制到 sftp 服务器
【问题讨论】: