ftplib and attributes

DeepBleu DeepBleu at DeepBleu.org
Thu Apr 25 16:04:46 EDT 2002


"LoGan" <giannivolontosky at TOGLIyahoo.it> wrote in message
news:pan.2002.04.25.21.35.03.529909.14114 at TOGLIyahoo.it...
> hi, im new bie and im trying to use ftplib, but my problem is to get the
> attributes of the files, how can i do ?
> LoGan

What attributes of what files?  The remote files on the server you are
FTPing?  If so:
>>> from fttlib import FTP
>>> ftp = FTP(host, username, password)
>>> ftp.dir()

This last one will give you a list of files of the active directory on the
remote server and their attributes.  Do you want to save this list?

>>> flist = []
>>> ftp.dir(flist.append)
>>> for l in flist:
>>>   print l
Also, even though you are a newbie, you should learn how to check the docs
and search the web.  All this above you can find.
DeepBleu





More information about the Python-list mailing list