i'm doing a simple upload to an FTP server using the ftplib module and
wanted to know how i can preserve the file modification date all the way
through the process. I lose the file mod date because i read the original
file then ftp writes a new file to the server which changes the mod dateto
the time and date of the file transfer.
Here is the basic code i used;

for file in os.listdir("C:\\dir"):
        i=file  # i catpures file
        z="STOR " + i     #STOR is upload command to FTP server
        filename=open(i,'r')
        f.storlines(z,filename) #FTP upload command

        filename.close()
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to