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 t开发者_运维百科o identify whether it's updated or not is a problem.
Does Anybody have any experience on this?
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.
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.
精彩评论