I have in my code in c, this function:
fseek(file, 0, SEEK_SET);
I need to use the same function with Arduino ide. Is this correct?
file.seek(file.size());
Or what is the alternative function in Arduino ide?
I have in my code in c, this function:
fseek(file, 0, SEEK_SET);
I need to use the same function with Arduino ide. Is this correct?
file.seek(file.size());
Or what is the alternative function in Arduino ide?
According to https://www.arduino.cc/reference/en/libraries/sd/seek/ :
Seek to a new position in the file, which must be between 0 and the size of the file (inclusive).
file.seek(pos)
If you want to seek to the start of the file, therefore you should seek to zero, not file.size()
. Using file.size()
would seek to the end of the file.