when trying to transfer the file like .txt .xml etc. But when transferring whole directory to another it is giving error. let me know what is wrong with the code. why it is not transferring the directories
import paramiko
import os
paramiko.util.log_to_file('/tmp/paramiko.log')
host = '10.2.216.195'
t = paramiko.Transport((host))
t.connect(username = 'stack',password = 'flow')
sftp = paramiko.SFTPClient.from_transport(t)
filepath = '/home/proteek'
localpath = '/home/proteek/newfolder/movie'
sftp.get(localpath,filepath)
sftp.close()
t.close()
it is giving an error which is
File "/usr/lib/python2.6/site-packages/paramiko/sftp_client.py", line 599, in get
fl = file(localpath, 'wb')
IOError: [Errno 21] Is a directory: '/home/proteek/movie'