如何从ftp位置获取按创建日期排序的子目录列表。我使用以下代码。但它按名称排序
import ftplib
def sortFTPDir(dirpath):
f = ftplib.FTP(ip, username, password)
try:
f.cwd(dirpath)
nameList = f.nlst()
print "Sorted Directory List : ", nameList
for p in range(len(nameList)):
print nameList[p]
except Exception, e:
print str(e)
finally:
f.close()