to_i()
Returns an integer representing the numeric file descriptor for the current file. Raises an ArgumentError if there isn’t a current file.
ARGF.fileno #=> 3
static VALUE argf_fileno(VALUE argf) { if (!next_argv()) { rb_raise(rb_eArgError, "no stream"); } ARGF_FORWARD(0, 0); return rb_io_fileno(ARGF.current_file); }