Skip to content

Instantly share code, notes, and snippets.

@spiiin
Created November 27, 2013 17:42
Show Gist options
  • Save spiiin/7679944 to your computer and use it in GitHub Desktop.
Save spiiin/7679944 to your computer and use it in GitHub Desktop.
import os
import subprocess
def test(fname):
#run
p = subprocess.Popen(subprocStringPack%(fname))
p.wait()
p = subprocess.Popen(subprocStringUnpack%fname.replace(".bin",".001.cmp.bin"))
p.wait()
#check
outName = fname.replace(".bin",".001.cmp.0000.bin")
f1 = open(fname, "rb")
d1 = f1.read()
f1.close()
f2 = open(outName, "rb")
d2 = f2.read()
f2.close()
return d1 == d2
WAY_TO_DUMPS = ".............."
ffx = os.listdir(WAY_TO_DUMPS)
for fn in ffx:
print "Check", fn,
print test(os.path.join(WAY_TO_DUMPS, fn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment