createmanifests.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:binaryanalysis 作者: armijnhemel 项目源码 文件源码
def cleanupdir(temporarydir):
    osgen = os.walk(temporarydir)
    try:
        while True:
            i = osgen.next()
            ## make sure all directories can be accessed
            for d in i[1]:
                if not os.path.islink(os.path.join(i[0], d)):
                    os.chmod(os.path.join(i[0], d), stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR)
            for p in i[2]:
                try:
                    if not os.path.islink(os.path.join(i[0], p)):
                        os.chmod(os.path.join(i[0], p), stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR)
                except Exception, e:
                    #print e
                    pass
    except StopIteration:
        pass
    try:
        shutil.rmtree(temporarydir)
    except:
        ## nothing that can be done right now, so just give up
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号