All pastes #480703 Raw Edit

Untitled

public python v1 · immutable
·published 2007-05-10 12:10 UTC
rendered paste body
#!/usr/bin/env pythonimport zlib, sys, sreheader='x\xda'def main(args):        f = file(args[0], 'rb').read()        idx=0        res=0        while res != -1:                res = f.find(header,idx)                try:                        idx=res+1                        de = zlib.decompress(f[res:])                        open("%s.raw"%str(res),'w').write(de)                        print "OK"                except zlib.error:                        print "FATAL %i"%resif __name__=='__main__':    sys.exit(main(sys.argv[1:]))