If I set a Stdio.File object to buffer mode with both an input and an output buffer, is there a point in having a write callback registered? I can simply output data to the buffer and it will be written to the stream, right?
The write calback will only be called when the buffer is empty.
So it has a slightly different purpose. But it is not needed. You can use the filling callback in the buffer object instead, as an example.
I'll try to remember to add the bit about write callbacks to the docs tonight - it may become useful to others.
But wait, is there a callback mechanism on Stdio.Buffers too?
Yes. Inherit the buffer, then implement a function
bool range_error( int bytes ) { if( more data added to buffer ) return true; return false; }
pike-devel@lists.lysator.liu.se