[Twisted-Python] os.walk - like example

VanL news at southportal.net
Tue Aug 3 09:25:32 MDT 2004


Hello,

I am trying to use twisted to produce an os.walk -like traversal of a 
remote ftp site, but I am just not getting my head around it.  Simple 
things I have figured out, like

     def listdir(self, result, fileListProtocol):
         return fileListProtocol.files

     def isdir(self, ftpfile):
         return ftpfile['filetype'] == 'd'

     def islink(self, ftpfile):
         return ftpfile.has_key('linktarget')

Similarly, I see the commands that I need to use.  I just can't seem to 
get it all together into a package that can do a walk of the remote 
directory.  Can anyone help?

Thanks,

VanL





More information about the Twisted-Python mailing list