I have finally gotten back to this...
I have installed the SdFat library and have been having fun seeing what I can do with it.
I got a FreeSpace function up and running very quickly. I then found a TimeStamp function in the library examples and that was something I was really looking for so I played around with that, for way too long, and can now set file creation, modification and accessed datetime stamps.
I went back to my file I/O operations and played with opening, writing to and closing my files with the new library. That works fine.
However all of this leads me to 2 questions:
How can I read/display the size of my file?
With the SD library I would probably use the ls object with a LS_SIZE call. But how do I do this for my individual file object?
How do I recalculate the FreeSpace as I get the feeling it's showing me cached info or something.
In my loop() I read the free space, write a line to my file wait 10 seconds and do it all again. The amount of free space never changes although I can see, afterwards, that my lines are being properly appended to my file and its size is getting bigger and bigger.
What I would like to do is:
loop{
ShowFreeSpace();
WriteLineToFile();
ShowFileSize();
delay(10000);
}
That ShowFreeSpace() function currently returns the same value each time.
WriteLineToFile() works fine
ShowFileSize() I don't know how to do
Once I can learn these 2 points my next step will be getting date and time from an NTP server and using that to datetime stamp my files.
Thanks!