Go Down

Topic: SD card lib, seek to last line (Read 991 times) previous topic - next topic

stoopkid

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.

PaulS

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.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy