i see there is an instruction file.size(). and it is working in my sketch also. But is that an instruction which you must do, when the file is open on the SD card ? Or is it also possible after a close the file
i actually want to know the size of the file after all data is saved, and that is now when i close the file
Did a test, en found out that it can only be done when the file is open, so than he knows which file has to be checked.. So what i do now, is when file is open , use flush, than check the size and than close it
Before myFile.println("testing 1, 2, 3."), the size was zero and after size returned 18. The size of "testing 1, 2, 3.\r\n" is 18. println adds the CR/LF.
File size will be updated several times while the above statement executes. I wrote SdFat so I know that file size is updates after each << insertion operator.
When the entire statement has finished, calling flush will not change the value returned by file size.
The value returned by file size after the file is closed may or may not be correct for the last file that was open.