I am downloading a file from an ftp location and able to do it successfully with below code-
import ftplib
server = ftplib.FTP()
server.connect('HOST', PORT)
server.login('USER_NAME','PASSWORD')
server.dir()
server.retrbinary("RETR " + 'xyz.csv' ,open('xyz.csv', 'wb').write)
server.quit()
Now I have a requirement- need to check if the above file is updated then I need to run another python script.
For this purpose I thought to use the last modified date but unable to see any method in ftplib library for this.
Has anyone faced the same issue? How it can be resolved? Please suggest how to do it?