2008/5/18 Colin Putney cputney@wiresong.ca:
On 17-May-08, at 1:36 PM, Avi Bryant wrote:
On Sat, May 17, 2008 at 9:48 AM, Colin Putney cputney@wiresong.ca wrote:
Heh - I've long had nearly the opposite question: Why was support for read-write streams ever needed? I can't recall *ever* using it in my own code, nor encountering it in anyone else's.
What about files?
Good point. A lot of files are read-only or write-only, but not always. MC2's file repository both reads and writes on the same file stream. So I guess I have encountered it in someone else's code. :-) Still, I do think separate streams for reading and writing to the same file would be fine as an API. Colin
Want to second that. In most cases read and write operations (even operating with same device) serving different purposes, and really can be used apart without much increase in code complexity.
Unless you using another trait - a positionable stream, the write and read streams can be easily decoupled.