ftplib LIST question

Al spohn at nospam.mayo.edu
Tue Aug 6 05:23:59 CEST 2002

I'm interested in parsing the output of retrlines('LIST') via a callback 
routine, e.g., retrlines('LIST',mycallbackroutine()).  I'm an absolute 
python newbie, but I'm pretty experienced with regular expressions so 
I'm not so concerned with carving up the lines once I get them... my 
immediate problem is what special variable (or whatever... something 
like the perl $_ maybe?) represents each line in the context of the 
callback routine.

Of course, if there's a smarter way of handling this I'm completely open 
to suggestions.  I'm always hitting the same server so I'm assuming the 
directory listing will be static.  I need to process each filename in 
turn and base my logic on the filename.

Thanks in advance,

- Al

More information about the Python-list mailing list