Mailing List Archive

Higher level FTP lib?
Hi,

I wonder if there is a FTP module for python that allows for higher
level operations than ftplib. With ftplib, I have to parse LIST lines
myself (footnote: is there a module for *that* like perl's
File::Listine?) if I want to know file size or date.

Due to the OO nature of Python I was pretty sure the FTP library would
make FTP sites look like local directories. Would be really nice.

Falk
Higher level FTP lib? [ In reply to ]
>I wonder if there is a FTP module for python that allows for higher
>level operations than ftplib. With ftplib, I have to parse LIST lines
>myself (footnote: is there a module for *that* like perl's
>File::Listine?) if I want to know file size or date.

You could use urllib instead. It works like this:

import urllib
file = urllib.urlopen('ftp://ftp.python.org/pub/python/src/py152.tgz')

The file object you get back is pretty much the same as a file object you
would get from an open() command.