I have been struggling with the SD Card functions for months and have only just realised that the documentation doesn't include most of the opening modes - especially the one I really need to use.
There is also no mention that opening without specifying a mode defaults to READ ONLY, or even a hint that the file position pointer is set to EITHER the start or end of the file, depending on the opening mode.
All I want to do is over-write one of eight files with a new set of 32 values in the same locations in the file, to allow them to be used as alternative startup parameters for the machine I've built.
Looking in the library files tells me that there are lots of modes, but I can't find any examples of the syntax to use in my code.
At startup, I open a file and transfer the contents into a memory array. That works OK using FILE.open with no parameters.
Subsequently I can edit the parameters, and I may need the again, so I want to save them.
I have set up eight files, to allow a variety of settings to be stored, but I can currently only do it if I create a new file every time, as the data gets appended to the existing contents.
Using seek(0) only resets the write pointer to the end of the existing data - i.e. the append mode is enforced.
Any help will be gratefully received.