def read_file(self, filelisting, size=-1):
        """ Given a filelisting object return its data
            This requies checking each blockhash to find the next block.
            In some cases this requires checking two different hash tables.
        """
        buf = StringIO()
        if size == -1:
            size = filelisting.size
        block = filelisting.firstblock
        info = 0x80
        while size > 0 and block > 0 and block < self.allocated_count and info >= 0x80:
            readlen = min(0x1000, size)
            buf.write(self.read_block(self.fix_blocknum(block), readlen))
            size -= readlen
            blockhash = self.get_blockhash(block) #TODO: Optional concurrent verification of blocks
            #If there are multiple tables and the block is free or unused, try other table
            #TODO: There may be times where both tables show allocated blocks yet only one was correct
            #      It would be better to calculate the best chain of blocks, perhaps precalculate like Partition
            if 0 > self.table_size_shift and blockhash.info < 0x80: 
                blockhash = self.get_blockhash(block, 1)
            block = blockhash.nextblock
            info = blockhash.info
        return buf.getvalue()
dataset/ETHPy150Open arkem/py360/py360/stfs.py/STFS.read_file/swapped operands of `>`