https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-03-28T21:35:02ZRuby Issue Tracking SystemBackport200 - Backport #8175: ARGF#skip doesn't work as documented.https://bugs.ruby-lang.org/issues/8175?journal_id=379962013-03-28T21:35:02Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>pritamdey (pritam dey) wrote:</p>
<blockquote>
<p>from the doc: <a href="http://www.ruby-doc.org/core-2.0/ARGF.html#method-i-skip" class="external">http://www.ruby-doc.org/core-2.0/ARGF.html#method-i-skip</a></p>
<p>ARGF#skip :- Sets the current file to the next file in ARGV. If there<br>
aren't any more files it has no effect.</p>
</blockquote>
<p>ARGF isn't a class, so it's ARGF.skip.</p>
<blockquote>
<p>Code - I:<br>
Question- Why after the line B, line in A printing all the file names?</p>
</blockquote>
<p>ARGF.skip just sets the current file, argv is untouched.</p>
<blockquote>
<p>Code II:<br>
Question- Why after the line A, line in B printing <code>a.txt</code> as current<br>
file?</p>
</blockquote>
<p>Before the line A no files is assigned to the current file, and<br>
ARGF.skip tries to open the next file, "a.txt".</p>