Python Forum
How can I get last modified time of a file in ftp?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I get last modified time of a file in ftp?
#1
Hi All,

There are some files put in a ftp location.
I am able to connect, see the files and download in local successfully with below code written in Python3.6-
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()
I need to know the last modified time of a file in that ftp location so that if file is updated I can proceed with my other code.

But I am not able to find a way to achieve this.
Can anyone please help me how to do it?

Thanks!
Reply
#2
See this
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020