File Directory Ruby

f = File.open("text.txt", "r+")
f.putc "X"
f.close