close

ARGF.close â ARGF
Instance Public methods
1
2
3
Closes the current file and skips to the next in the stream. Trying to
close a file that has already been closed causes an +IOError+ to be
raised.

For example:

1
2
3
4
5
6
7
$ ruby argf.rb foo bar
 
ARGF.filename  #=> "foo"
ARGF.close
ARGF.filename  #=> "bar"
ARGF.close
ARGF.close     #=> closed stream (IOError)
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.