Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import sys
- import zipfile
- gameFiles = ("meta", "gamestate")
- outFile = "game.sav"
- gfPath = "."
- gameData = {}
- for gameFile in (gameFiles):
- with open(gfPath + "/" + gameFile, 'rb') as curFile:
- gameData[gameFile] = curFile.read()
- zf = zipfile.ZipFile(outFile, mode='w')
- try:
- for gameFile in gameFiles:
- info = zipfile.ZipInfo(gameFile, date_time=(1980, 0, 0, 0, 0, 0))
- info.compress_type=zipfile.ZIP_DEFLATED
- info.create_system=0
- info.create_version = 63
- info.extract_version = 20
- zf.writestr(info, gameData[gameFile])
- finally:
- zf.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement