Re[2]: [fpc-pascal] read lines at end of file

2011-04-12 Thread José Mejuto
Hello FPC-Pascal, Tuesday, April 12, 2011, 1:09:34 AM, you wrote: RW> On 04/11/2011 12:32 PM, John Lee wrote: >> Need to read the last 4 lines (txt) of a very large log file 100M >> bytes, 100k lines or more lots of times - of course I can read RW> Hmm, could first have the reader enumerate th

Re: Re[2]: [fpc-pascal] read lines at end of file

2011-04-11 Thread johnelee1944
So the idea is to open file eg as file of array [1:65536] of char or something similar, seek & read to end of file, then go through the last array converting to strings by finding crlfs correct? Is this the simplest way? If not any outline code? John On , José Mejuto wrote: Hello FPC-Pas

Re[2]: [fpc-pascal] read lines at end of file

2011-04-11 Thread José Mejuto
Hello FPC-Pascal, Monday, April 11, 2011, 7:55:01 PM, you wrote: >> The idea is easy, instead reading forward, you read backwards in >> blocks of, say, 64 Kb and count lines back. If not enougth lines you >> insert another 64 Kb before and so on. Average line is usually less >> than 100 bytes, so