Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top