From: Ronald Fischer Date: 2007-08-24T20:01:16+09:00 Subject: Re: How to append some data at the beginning of a file > I am newbie to Ruby so please spare me if the question looks silly. My > question is how to append data at the beginning of a file? This is not so much a Ruby question, since nearly no operating system directly allows appending data to the beginning of a file. The general solution is to create a new file, putting there the data in the right order, delete the old file and rename the new file to the name of the old one. Renaming a file is done like this: File.rename("oldname","newname") This raises the exception SystemCallError, if renaming fails. HTH Ronald -- Ronald Fischer Phone: +49-89-452133-162