<br><br><div><span class="gmail_quote">On 10/20/05, <b class="gmail_sendername">Stefan Schwarzer</b> &lt;<a href="mailto:sschwarzer@sschwarzer.net">sschwarzer@sschwarzer.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;&nbsp;&nbsp;&nbsp;&nbsp; filenames = host.listdir('')<br><br>As with os.listdir, you should pass in &quot;.&quot; (=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 &quot;.&quot;.&nbsp;</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>
&nbsp;&nbsp;&nbsp; def is_remote_newer(self, remote, local):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If remote is newer than local, return `True`, else return<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `False`.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.__copy_file_if_newer(remote, local, '',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.path.getmtime, self.__shifted_local_mtime,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>