From: Li Chen Date: 2006-11-27T05:49:03+09:00 Subject: Re: How to re-name a file from Ruby script > > filename is only a ruby string, it has no relationship with your > filesystem. > If you want to change the name of a file, you should use the File.rename > method: > > Dir.entries(path).each do |filename| > if filename=~/(LIPID5-2)(\.\w+)/i > File.rename(filename, filename.gsub(/LIPID5-2/,'LIPID5-3')) > end > end > > Stefano Stefano, Thanks and method File.rename is what I want. Li -- Posted via http://www.ruby-forum.com/.