SdFat seek() and position() functions?


My project includes incoming data being processed and logged into an SD card, using the Arduino DUE. Lets say I have a file.csv with entries looking like A,B,C,D (A,B are ints and C,D are floats).



Now after logging, I want to read the values of ‘D’ starting from the buttom going up towards the top of the file.

I recieved advice regarding seek() and position() as it may help me to do exactly what to do, but <SD.h> is compiling issues with <SdFat.h>. Because I want fast reads (50Hz), I do not want to use a while() to scroll down each time. Seek() using pointers which is perfect for my application.

Are there seek() and position() functions in SdFat?
Any other suggestions?


If there is not to much data in the file, why dont you read the whole file into an array and read that in reverse.

If you use sdfat.h than you better not use SD.h as the latter is more convenience level SD handling (IIRC) and the SDFat is for more detailed control.

Either use one library or the other.

My choice is for sdfat as it is more stable and gerenrally works faster.

The functions you are looking for exist and are very well documented in the sdfat documentation.