[Tutor] sftp get single file

Sander Sweers sander.sweers at gmail.com
Mon Jul 20 23:32:36 CEST 2009


2009/7/20 Matt Herzog <msh at blisses.org>:
> remotepath = 'datestr'

Ok, you are now making a string.

> remotepath = datestr

Like Kent wrote the datestr can include other characters. So I would
try "/%Y%m%d.tab".

> sftp.get(remotepath, localpath)
>  File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 587, in get
>  IOError: [Errno 21] Is a directory: '/tmp/testor/'

paramiko still can not find the file.

> So remotepath is really more like a path + filname.

Yes.

> So I need to do something like os.join the two?

You probably mean os.path.join(), you can use it but imho it is
overkill in your case. Just make sure you get the full path to the
file in your remotepath.

Greets
Sander


More information about the Tutor mailing list