Pages: [1]   Go Down
Author Topic: SD card lib, seek to last line  (Read 798 times)
0 Members and 1 Guest are viewing this topic.
California
Offline Offline
Sr. Member
****
Karma: 3
Posts: 443
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it possible to seek to the last line of a file without having to read it all into memory? I want to be able to "pick up where I left off" in terms of number being played with but my file will be way too big to read through the whole thing.

Thanks.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 50115
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I want to be able to "pick up where I left off" in terms of number being played with
You can record where you last wrote to the file.

Are all the records the same size? If so, you could determine the file size, subtract the length of one record, and seek to that position.

Quote
but my file will be way too big to read through the whole thing.
Then, a redesign is in order, using multiple files to reduce the size of each.
Logged

Pages: [1]   Go Up
Jump to: