From: "Jesús Gabriel y Galán" Date: 2013-01-18T00:13:41+09:00 Subject: Re: Adding file directory automatically On Thu, Jan 17, 2013 at 3:53 PM, Adam Kennedy wrote: > I have a bit of code that will add an amount to an array and then print > that back on the right line of a text file. Its basically a recorded > bidding system. However, is it possible to add the file location for > File.open('/path/to/file/') dynamically rather than having to create a > new bid.cgi file for every single bid. I have 12 items which need to be > edited so essentially it needs to be able to change to 12 file names and > locations. I'm not sure what problems you are having exactly, File.open can receive a variable: a = "file.txt" File.open(File.join("home","jesus","temp",a), "w") do |f| #do your stuff end You can choose values for a and do the same stuff in different files. BTW, as you mention cgi I assume this is going to be published on the internet. I advise you to be careful about how you choose the files for security reasons. For example, don't let the files be anywhere in your filesystem or you might compromise your server. Jesus.