import os
import hashlib
import time
#
def getFileMd5(filename):
if not os.path.isfile(filename):
return
myhash = hashlib.md5()# create a md5 object
f = file(filename,'rb')
while True:
b = f.read(8096)# get file content.
if not b :
break
myhash.update(b)#encrypt the file
f.close()
return myhash.hexdigest()
def walk(path, prefix):
global xml
fl = os.listdir(path) # get what we have in the dir.
for f in fl:
if os.path.isdir(os.path.join(path,f)): # if is a dir.
if prefix == '':
walk(os.path.join(path,f), f)
else:
walk(os.path.join(path,f), prefix + '/' + f)
else:
md5 = getFileMd5(os.path.join(path,f))
xml += "\n\t\t\"%s\" : {\n\t\t\t\"md5\" : \"%s\"\n\t\t}, " % (prefix + '/
cocos2dx-3.x 用脚本生成 AssetsManagerEx自动更新所需的manifest文件
最新推荐文章于 2018-11-20 14:35:01 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)