Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filename = ARGV[0]
- def read_file_one(filename)
- if File.readable?(filename) and !File.directory?(filename)
- File.read(filename)
- else
- raise "Cannot read #{filename}"
- end
- end
- def read_file_two(filename)
- begin
- return File.read(filename)
- rescue Exception => e
- raise e
- end
- end
- begin
- puts read_file_one(filename)
- rescue Exception => e
- $stderr.puts e.message
- end
- begin
- puts read_file_two(filename)
- rescue Exception => e
- $stderr.puts e.message
- end
Add Comment
Please, Sign In to add comment