File Directory Ruby

f = File.open("text.txt", "r+")
f.write "123456"
f.close