When an existing non empty file is successfully opened by fopen() in "a+" or "ab+" mode, I should be able to read from it or write to the end without an initial call to fseek() or rewind(). Does the C Standard specify that an initial read from this file will read from the beginning of the file or should I always set the file position before reading?
The C Standard seems ambiguous as it states in 7.21.5.2 the fopen function that:
6. Opening a file with append mode (
aas the first character in themodeargument) causes all subsequent writes to the file to be forced to the then current end-of-file, regardless of intervening calls to thefseekfunction. In some implementations, opening a binary file with append mode (bas the second or third character in the above list ofmodeargument values) may initially position the file position indicator for the stream beyond the last data written, because of null character padding.
On those systems where the file position indicator would point at or beyond the last data written, would an initial reading operation fail?