File operations in Ruby

File concepts in Ruby This Ruby program opens file in write mode and writes text in it. Then opens the program in read mode and reads the contents. Code:
  1. span style="color:#996600;">'test.txt','w'"Welcome to LivetoLearn.in""Thank you! Visit Again"'test.txt','r'
Output:
Welcome to LivetoLearn.in
Thank you! Visit Again