let buffer_size = 4096 let buffer = String.create buffer_size let rec tail desc size nb = if size > 0 then begin let real_size = min size buffer_size in let offset = size - real_size in set_pos desc offset; really_read desc buffer 0 real_size; try let index = find_lines buffer real_size nb in offset + index with Not_enough_lines missing -> tail desc offset missing end else 0;; |