retrieving file contents only if changed

8 views
Skip to first unread message

nbecker

unread,
Nov 30, 2011, 10:52:02 AM11/30/11
to pic...@googlegroups.com
I'm retrieving results (stored in files in pickle format) and storing them locally.  I wanted to retrieve them only if they changed (basically, re-implementing sync_from_cloud).

I used get_md5() and then I calculated the md5 from my local file using;

hashlib.md5 (open (file, 'r').read()).hexdigest()

but it appears the md5 I calculate locally never matches the md5 I get from get_md5().

Any ideas?

nbecker

unread,
Nov 30, 2011, 10:59:40 AM11/30/11
to pic...@googlegroups.com
Never mind - I got it working - my mistake

Aaron Staley

unread,
Nov 30, 2011, 5:59:16 PM11/30/11
to pic...@googlegroups.com
Hi,

Glad it all worked out.
Quick question: Was there some functionality you needed that sync_from_cloud didn't offer?

Best,
Aaron

Neal Becker

unread,
Nov 30, 2011, 7:32:25 PM11/30/11
to pic...@googlegroups.com
I wanted to know when a file was updated, so I implemented the md5 check myself.
Reply all
Reply to author
Forward
0 new messages