close_write()
public
Show source
/*
* call-seq:
* strio.close_write -> nil
*
* Closes the write end of a StringIO. Will raise an +IOError+ if the
* *strio* is not writeable.
*/
static VALUE
strio_close_write(self)
VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (!WRITABLE(ptr)) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
ptr->flags &= ~FMODE_WRITABLE;
return Qnil;
}