def truncate(self, path, size): # {{{3
    try:
      self.__log_call('truncate', 'truncate(%r, %i)', path, size)
      if self.read_only: return -errno.EROFS
      inode = self.__path2keys(path)[1]
      last_block = self.block_size / size
      self.conn.execute('DELETE FROM "index" WHERE inode = ? AND block_nr > ?', (inode, last_block))
      self.conn.execute('UPDATE inodes SET size = ? WHERE inode = ?', (size, inode))
      self.__gc_hook()
      self.__commit_changes()
      return 0
    except Exception, e:
      self.__rollback_changes()
      return self.__except_to_status('truncate', e, errno.ENOENT)
dataset/ETHPy150Open xolox/dedupfs/dedupfs.py/DedupFS.truncate/swapped operands of `/`