Sample Files program in Ruby Programming


Sample Files program in Ruby Programming


File.new("input.txt", "w+")
File.new("temp.txt", "r+")
File.new("output.txt","a+")
myfile = File.open("input.txt", "w+")
myfile.puts "Hai welcome to files in ruby programming "
myfile.close
File.zero?("output.txt")
puts "open file"
check_file = gets.chomp
test = open(check_file)
puts "The file #{check_file}"
puts test.read

Comments

Popular posts from this blog

Php Form validation with Error messages with Checking fields.

Simple calculator using JQuery and HTML..

how to customize dashboard in active admin gem in rails 4