1

I've been working on a Python project. Main goal is to retrieve files (name and last used time).

I'm working on a quite large company and we have dozens of different servers that I need to check.

I've been working with the ftplib to collect file names and last used time but as I'm working with a lot of servers, some of them doesn't accept some fundamental commands like NLST or MLSD.

So, my last acceptable thing to do is to use the LIST command which is returning something different depending on the server.

How should I grab my data without knowing the target FTP server? (like an universal way of doing it)

Thanks.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Cesar
  • 453
  • 9
  • 21

1 Answers1

0

The "universal way of doing it" is MLSD (not MLSN). The very reason for introducing MLSD (which is was introduced relatively late to FTP – relatively in the context of the ancient FTP protocol), is to have a machine readable format of the listing.

If you do not have MLSD, you do not have a "universal way of doing it".

Related question: How to get FTP file's modify time using Python ftplib.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992