Why not "list = ftplib.FTP.dir()" ?

trylks trylks at gmail.com
Mon Feb 7 17:26:07 EST 2011


I don't know if it is ftplib or just me, but something feels terribly wrong
in this:

from ftplib import FTP
> from functools import partial
>
> class MyFTP(FTP):
>   def dir(self):
>     l = []
>     super(MyFTP, self).dir(partial(lambda l, e: l.append(e.split()), l))
>     return l
>

Unfortunately 'MLSD' is not available in the server I have to use. (I need
to get the list of folders and files modified since last access, hence
split).

Cheers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110207/71faf945/attachment.html>


More information about the Python-list mailing list