belorion wrote:
> What am I missing here (apologies if this is just my 7am brain fog
> speaking):
> 
> The contents of my file (test) are:
> 1
> 2
> 3
> 4
> 5
> 6
> 
> f = File.open('test')
> f.lineno = 4
> puts f.readline # <= This returns 1, instead of 4 as expected [snip]

If remember that the docn says that lineno= just changes the current 
value of lineno -- if you check the result of f.lineno after your 
f.readline above, you'll get 5.  Not sure how useful that behavior is, 
but that's how it's defined....

Suggest that you read the file into memory and split it by lines 
(File#readlines IIRC, not near the manual now).

-- 
Posted via http://www.ruby-forum.com/.