ecu_jon wrote:
yes i agree breaking stuff into smaller chunks is a good way to do it.
even were i to do something like
def safe_copy()
f1=file(files ,'rb')
f2 = file(os.path.join(currentdir,fname,files))
truth = md5.new(f1.read()).digest() ==
md5.new(f2.read()).digest()
ecu_jon wrote:
so i am trying to add md5 checksum calc to my file copy stuff, to make
sure the source and dest. are same file.
i implemented it fine with the single file copy part. something like :
for files in sourcepath:
f1=file(files ,'rb')
try:
yes i agree breaking stuff into smaller chunks is a good way to do it.
even were i to do something like
def safe_copy()
f1=file(files ,'rb')
f2 = file(os.path.join(currentdir,fname,files))
truth = md5.new(f1.read()).digest() ==
md5.new(f2.read()).digest()
if truth == 0:
so i am trying to add md5 checksum calc to my file copy stuff, to make
sure the source and dest. are same file.
i implemented it fine with the single file copy part. something like :
for files in sourcepath:
f1=file(files ,'rb')
try:
shutil.copy2(files,
You're not really supposed to call into the md5 module directly anymore; you
might use hashlib instead.
But actually, using a cryptographic hash doesn't really help comparing just
one pair of files; it's more certain to do a block by block comparison, and
the I/O time is roughly the same -