[Tutor] paramiko again
Alan Gauld
alan.gauld at btinternet.com
Sun May 10 09:56:05 CEST 2009
"Matt Herzog" <msh at blisses.org> wrote
> Yes, that is exactly what I wanted, os.listdir. But now I have another
> issue:
> specifying the remote dir. When I login to the sftp server and type pwd:
>
> sftp> pwd
> Remote working directory: /
>
> Is what I see.
OK, so either you have to change dir on the remote machine(via sftp)
or you use the / directory.
> Also, I don't think I want "join" in the below, do I? Why do I want to
> "join" the two dirs?
I'm not sure whether you should use join either. I think the first agument
should be the path not the fuill filename, but I may be wrong. But at least
you need to pass '/' as your path.
> sftp.get(os.path.join(dir_path, f), f)
dir_path = '/'
sftp.get(dir_path, f)
If that doesn't work put the join back in...
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list