<br><br><div><span class="gmail_quote">On 10/20/05, <b class="gmail_sendername">Stefan Schwarzer</b> <<a href="mailto:sschwarzer@sschwarzer.net">sschwarzer@sschwarzer.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> filenames = host.listdir('')<br><br>As with os.listdir, you should pass in "." (=FTPHost.curdir) for the<br>current directory.</blockquote><div><br>
Thanks for the clarification. That was the first thing I tried, but I
changed while trying to understand why it was failing and forgot to
change it back. It might be nice if the argument to listdir had a
default value of ".". </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I think your assumption is right, and as far as I see your change should
<br>work though it seems a bit obscure. ;-) Let me think about if I put in<br>the next release. I think that's ok for you, considering the license,<br>isn't it?</blockquote><div><br>
I'm good to go, just feeding back. In a similar vein, I also found the
following method of FTPHost (actually a class I derived from it where I
am isolating my changes) to be useful:<br>
<br>
def is_remote_newer(self, remote, local):<br>
"""<br>
If remote is newer than local, return `True`, else return<br>
`False`.<br>
"""<br>
return self.__copy_file_if_newer(remote, local, '',<br>
self.path.getmtime, self.__shifted_local_mtime,<br>
os.path.exists, lambda x,y,z: None)<br>
<br>
I wasn't sure if there was another way to perform the same arithmetic
that occurs in download_if_newer/upload_if_newer without actually
download/uploading the file. In my script, the download takes a while
so I want to notify the user before it starts so the user knows what's
taking so long.<br>
<br>
Thanks again,<br>
Alex<br>
</div><br></div>