1 file = File.open( foo.txt , r ) 2 whole_file = 3 4 while (input_line = file.gets) 5 whole_file += input_line 6 end 7 8 puts Contents of input file: 9 puts whole_file Opens the file for read access Will store the file to display Prints out the file (c) 2012 Ophir Frieder et al
{}