Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
IO#autoclose?
() -> bool
ios.autoclose? → true or false
io.c
View on GitHub ↗
static VALUE
rb_io_autoclose_p(VALUE io)
{
rb_io_t *fptr = RFILE(io)->fptr;
rb_io_check_closed(fptr);
return RBOOL(!(fptr->mode & FMODE_EXTERNAL));
}
Returns true if the underlying file descriptor of ios will be closed at its finalization or at calling close, otherwise false.