Ji Yalin
Ji Yalin

Reputation: 1250

How to get the modified time attribute of a certain file on FTP

I need to monitor a certain file on FTP, once it had been updated, I need to fetch it from FTP. but how to identify whether it's updated or not is a problem.

Does Anybody have any experience on this?

Upvotes: 0

Views: 655

Answers (2)

Jan Šotola
Jan Šotola

Reputation: 852

File modification data and time can be also obtained using a MLST or a MDTM command. Both ones are extensions of FTP protocol (not guaranteed on all servers), but at least some of them is supported by most servers. These commands return standardized format, it has not to be parsed like results of LIST command.

See the more details in this article.

Upvotes: 1

Richard Szalay
Richard Szalay

Reputation: 84824

You need to send a LIST command. You'll need to parse the results manually using regex, since there is no standard format for the return result.

Upvotes: 1

Related Questions