appcompat_csv.py 文件源码

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

项目:appcompatprocessor 作者: mbevilacqua 项目源码 文件源码
def processFile(self, file_fullpath, hostID, instanceID, rowsData):
        rowNumber = 0
        rowValid = True
        file_object = loadFile(file_fullpath)
        csvdata = file_object.read().splitlines()[1:]
        file_object.close()

        data = csv.reader(csvdata, dialect='IngestDialect1')
        for row in data:
            for field in row:
                if b'\x00' in field:
                    settings.logger.warning("NULL byte found, ignoring bad shimcache parse: %s" % field)
                    rowValid = False
            if rowValid:
                path, filename = ntpath.split(row[2])
                namedrow = settings.EntriesFields(HostID=hostID, EntryType=settings.__APPCOMPAT__, RowNumber=rowNumber,
                                                  LastModified=unicode(row[0]), LastUpdate=unicode(row[1]),
                                                  FilePath=unicode(path),
                                                  FileName=unicode(filename), Size=unicode(row[3]),
                                                  ExecFlag=str(row[4]), InstanceID=instanceID)
                rowsData.append(namedrow)
                rowNumber += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号