Pretending to be a Microsoft developer? Why? Isn't the word "class" in the file sufficient to define that TextFile is a class?
You may not like the Microsoft naming convention but I have not come across a better one.
The C clearly denotes that identifier as a class, not a struct or anything else. When I first learned C at Latrobe University I also used the 'TextFile' type naming convention and, at times, I go confused between class definitions and variable names etc.
I also use the microsoft m_n.../n..., m_str.../str... naming conventions.
Sometimes I invent my own along similar lines, e.g. m_array.../array...
It just avoids so much confusion when you return to your code months or years later.
Is that the case WITHOUT using the wrapper class? In other words, are we debugging a hardware problem (with the SD shield), a software problem (with the SD and related classes), or a development problem (with your wrapper class)?
My wrapper class functions just call functions on the TextFile object inside so I can't see how that can be a problem.
Like I said I can edit the contents in windows and then read them just fine on the arduino.
It has got to be something to do with the way I am opening the file.
The examples show you how to read a file, append to a file and create a file.
But there are none that show you how to rewrite a file - open it for writing and empty the contents, i.e. no examples that use the o_trunc attribute.
I am wondering if that is the cause of this strange error.
Come to think of it I originally was opening files for writing using O_WRITE | O_CREATE, and assumed that it was equivalent to that in Unix and Borland C where it would open the file for writing and empty the contents.
But instead I found that that O_WRITE | O_CREATE was the same as readwrite in the other to platforms, and I was appending new data to the end of the existing contents.
Write operations were working fine then.
Perhaps I need to ditch this mode and have my wrapper class delete the file and then re-create it.
Then I can just append to the end of an empty file.