Created on 1999-07-20.00:00:00 last changed 171 months ago
[ Post-Tokyo: Dietmar supplied the above wording. ]
[ Kona: Dietmar is working on a proposed resolution. ]
Proposed resolution:
Change the unnumbered paragraph in 27.8.1.4 (lib.filebuf.virtuals) before paragraph 14 from:
pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | ios_base::out);
Alters the file position, if possible, to correspond to the position stored in sp (as described below).
- if (which&ios_base::in)!=0, set the file position to sp, then update the input sequence
- if (which&ios_base::out)!=0, then update the output sequence, write any unshift sequence, and set the file position to sp.
to:
pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | ios_base::out);
Alters the file position, if possible, to correspond to the position stored in sp (as described below). Altering the file position performs as follows:
1. if (om & ios_base::out)!=0, then update the output sequence and write any unshift sequence;
2. set the file position to sp;
3. if (om & ios_base::in)!=0, then update the input sequence;
where om is the open mode passed to the last call to open(). The operation fails if is_open() returns false.
Overridden virtual functions, seekpos()
In [filebuf] paragraph 3, it is stated that a joint input and output position is maintained by basic_filebuf. Still, the description of seekpos() seems to talk about different file positions. In particular, it is unclear (at least to me) what is supposed to happen to the output buffer (if there is one) if only the input position is changed. The standard seems to mandate that the output buffer is kept and processed as if there was no positioning of the output position (by changing the input position). Of course, this can be exactly what you want if the flag ios_base::ate is set. However, I think, the standard should say something like this:
Plus the appropriate error handling, that is...
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg1746 |
2010-10-21 18:28:33 | admin | set | messages: + msg1745 |
2010-10-21 18:28:33 | admin | set | messages: + msg1744 |
1999-07-20 00:00:00 | admin | create |