FTP file creation date

Larry Bates lbates at syscononline.com
Wed Oct 27 17:57:22 CEST 2004

[ EuGeNe ] wrote:
> Hi all,
> I would like to write a script that downloads one file from a ftp
> server if the file creation date satisfy a condition.
> I can't figure out how to find from a ftp server what is the creation
> date of the file (using python).
> Any idea?
> Thanks for your help!
> EuGeNe

I don't believe there is anything like .stat methods included
in ftplib.  I have always retrieved a directory of the files and
extracted the creation dates from each file manually.  Then
acted on them accordingly.  You should note that the dates on
most FTP servers are relative to the clock on that server (not
your local clock).  If the clock on FTP server is different
from yours, either because it is off or because it is in a
different timezone, you must adjust accordingly.

Larry Bates

More information about the Python-list mailing list