Over a million developers have joined DZone.

Read File

·
// file is closed when the block exits


  File.open("text.txt", "r") do |file| 
    file.each_byte do |ch|
      putc(ch)
      @count +=1
    end
  end
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}