Brett Kruger wrote in post #992039:
> line_count = 0
> File.open("text.txt", "r").each { |line| line_count += 1 }
> puts line_count
>
> [...] line_count always outputs 0 for me.

Change the "File.open(......" line to:

  puts "Last modified:", File.mtime("text.txt")
  puts "Size:", File.size("text.txt")

and see if the output makes sense.

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