Re: os.walk/list

2011-03-21 Thread Peter Otten
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()).dig

Re: os.walk/list

2011-03-20 Thread ecu_jon
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:

Re: os.walk/list

2011-03-20 Thread Peter Otten
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: > shutil.

Re: os.walk/list

2011-03-19 Thread Dan Stromberg
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 - actuall

os.walk/list

2011-03-19 Thread ecu_jon
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, os.path.join(dest