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 <joshy...@gmail.com> wrote:
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 each 64 Kb are usually more than 600 lines. Read of
>> 64 Kb usually takes the same time as read any lower amount when the
>> block is 4096 bytes aligned.
MG> You can not really read backwards. You can use
MG> something like TFileStream.Seek(-4096,soEnd).
I think that the "read backwards in blocks" already stated that fact,
but nice annotation.
--
Best regards,
José
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal