From: Gabriele Marrone Date: 2006-11-28T16:42:06+09:00 Subject: Re: how to write file before EOF On 28/nov/06, at 05:36, Siva Prakasam wrote: > how to write a file before its EOF > by giving some position . If you mean appending data to a file (not inserting data in the middle of a file), you can just open it with the "a" mode: File.open("mylog.txt", "a") do |f| f.puts "adding this line at the end" end However, if you want to insert data in the middle of a file without overwriting existing data, that's not so easy, as Paul pointed out. -- Gabriele Marrone