Method: ARGF#file

Defined in:
io.c

#fileFile object

Returns the current file as an IO or File object. $stdin is returned when the current file is STDIN.

For example:

$ echo "foo" > foo
$ echo "bar" > bar

$ ruby argf.rb foo bar

ARGF.file      #=> #<File:foo>
ARGF.read(5)   #=> "foo\nb"
ARGF.file      #=> #<File:bar>

Returns:



14397
14398
14399
14400
14401
14402
# File 'io.c', line 14397

static VALUE
argf_file(VALUE argf)
{
    next_argv();
    return ARGF.current_file;
}