os.stat - time format conversion + md5

DP pennedinil at excite.com
Tue Dec 17 09:47:13 EST 2002


Hello all,

I'm sure this has been asked before -- how do I convert the output of
os.stat(some_filename) to "plain" understandable time format, i.e.
DD/MM/YYYY HH:MM:SS.

I'm doing all this is because I copy/overwrite a large number of files
frequently. I'd rather be able to compare creation/modification dates
& signatures, and only overwrite the file if they don't match. I'm
considering using Python's built-in md5 module to generate these
signatures.

The problem is, the files are large, so I'd prefer to not read the
file, and then pass the contents of this file to md5 as a string. What
are my options? Is there any other function (other than CRC) that will
allow me to verify signatures on files?

Again, thanks in advance.

Dinil



More information about the Python-list mailing list