close()
public
Closes strio. The strio is unavailable for any further data
operations; an IOError is raised if
such an attempt is made.
Show source
/*
* call-seq:
* strio.close -> nil
*
* Closes strio. The *strio* is unavailable for any further data
* operations; an +IOError+ is raised if such an attempt is made.
*/
static VALUE
strio_close(self)
VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (CLOSED(ptr)) {
rb_raise(rb_eIOError, "closed stream");
}
ptr->flags &= ~FMODE_READWRITE;
return Qnil;
}