Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- The following block of code belongs to a program that is under construction currently
- =end
- #!/usr/bin/env ruby
- print "File name: "
- filename = gets.chomp
- unless File.file? filename
- puts "The given name '#{filename} is not a file"
- exit
- end
- unless File.readable? filename
- puts "The given file '#{filename}' is not readable."
- exit
- end
- File.open filename, 'r' do |f|
- f.each_line do |line|
- puts line
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement