Is there a rich ftp client library for Python? -
i'm familiar ftplib , works great simple interface need file properties , rich ftp client. know of ftp client library?
use mlsd command. have parse it's easy.
# note portions of mlsd data case insensitive... def parseinfo(info): fact in info.split(';'): if not fact: continue name, value = fact.split('=', 1) yield name.lower(), value ftp = ftplib.ftp(host, user, passwd) dirinfo = {} def callback(line): info, fname = line.split(' ', 1) dirinfo[fname] = dict(parseinfo(info)) ftp.retrlines('mlsd {}'.format(path), callback) print(dirinfo)
that's rich ftp gets.
Comments
Post a Comment