Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import struct
- def get_data(filename):
- totalbytes = os.path.getsize(filename)
- infile = open(filename, 'rb')
- totalfiledata = infile.read(totalbytes)
- infile.close()
- return totalfiledata
- mypath = os.path.dirname(os.path.realpath(__file__))
- filelist = []
- for dirName, subdirList, fileList in os.walk(mypath):
- filelist.extend([dirName + '\\' + f for f in fileList if os.path.splitext(f)[1] == '.arb'])
- output = []
- for f in filelist:
- filedata = get_data(f)
- f = os.path.splitext(os.path.basename(f))[0] + '.orig'
- outfile = open(f,'wb')
- outfile.write(filedata)
- outfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement