I am trying to use the SD library to read from a file on my card and use the contents. I copied a 160KB file to the card and opened it with the SD library, but the available() function says there are only 31854 available bytes.
If I use the read() function in a loop until there are no more bytes available, the program does only read 31854 bytes. How do I access all the data in my file?
It's a bug in SD.h, the wrapper for SdFat. available() does the 32-bit difference of filesize - current_position and incorrectly returns a 16-bit result.