Author giampaolo.rodola
Recipients giampaolo.rodola, pitrou
Date 2011-01-30.23:37:29
SpamBayes Score 1.64989e-05
Marked as misclassified No
Message-id <1296430651.22.0.68039486547.issue11072@psf.upfronthosting.co.za>
In-reply-to
Content
From RFC-3659:

   The MLST and MLSD commands are intended to standardize the file and
   directory information returned by the server-FTP process.  These
   commands differ from the LIST command in that the format of the
   replies is strictly defined although extensible.

The patch in attachment adds support for MLSD command.
This should ease the development of ftp clients which are forced to parse un-standardized LIST responses via dir() or retrlines() methods to obtain meaningful data for the directory listing.

Example:


>>> import ftplib
>>> from pprint import pprint as pp
>>> f = ftplib.FTP()
>>> f.connect("localhost")
>>> f.login("anonymous")
>>> ls = f.mlsd()
>>> pp(ls)
 {'modify': 20100814164724,
  'name': 'svnmerge.py',
  'perm': 'r',
  'size': 90850,
  'type': 'file',
  'unique': '80718b568'},
 {'modify': 20101207185033,
  'name': 'README',
  'perm': 'r',
  'size': 53731,
  'type': 'file',
  'unique': '80718aafe'},
 {'modify': 20100417183215,
  'name': 'install-sh',
  'perm': 'r',
  'size': 7122,
  'type': 'file',
  'unique': '80718b2d2'},
 {'modify': 20110129210053,
  'name': 'Include',
  'perm': 'el',
  'size': 4096,
  'type': 'dir',
  'unique': '8071a2bc4'}]
>>>
History
Date User Action Args
2011-01-30 23:37:31giampaolo.rodolasetrecipients: + giampaolo.rodola, pitrou
2011-01-30 23:37:31giampaolo.rodolasetmessageid: <1296430651.22.0.68039486547.issue11072@psf.upfronthosting.co.za>
2011-01-30 23:37:29giampaolo.rodolalinkissue11072 messages
2011-01-30 23:37:29giampaolo.rodolacreate