# File lib/kirbybase.rb, line 1063 def get_recs_by_recno(table, recnos) encrypted = table.encrypted? recs = [] recno_idx = get_recno_index(table) with_table(table) do |fptr| # Skip header rec. fptr.readline # Take all the recnos you want to get, add the file positions # to them, and sort by file position, so that when we seek # through the physical file we are going in ascending file # position order, which should be fastest. recnos.collect { |r| [recno_idx[r], r] }.sort.each do |r| fptr.seek(r[0]) rec, line_length = line_to_rec(fptr.readline, encrypted) next if rec.empty? raise "Index Corrupt!" unless rec[0].to_i == r[1] rec << r[0] << line_length recs << rec end return recs end end