wembley wrote:Actually, I purposely omitted the reset for the last iteration of the loop so that the file position would be at the end of the file when the next message was sent. If I had not done that then your observation that next would return the first character in the stream would be correct.
I think, that both VW and VA implementation fit the IEEE Std 1003.1, 2004 Edition (C Library Standard) as you mentioned it. My original posting is simply mentioning a bug - and you seem to have corrected it.
The other thing is the semantic programming model and VW has two file positions, which are handled independently. The programmer has no control about the write file position, but can only controls the read file position via his/her stream commands.
VA has only one position and this make the whole stuff very complicated to use. Each programmer (using this stream) must maintain its own read-position - external to this stream, because a write call (perhaps by a log manager in another module) may change the position .... one can see this in your own example.
But ok, leave it as it is. Nobody seems to use this class anyway in read AND append mode at the same time and everyone can write its own subclass to get the (in my opinion) much clearer VW behaviour ... and
I like to have the same behaviour at that level between VW and VA.