From: "Peña, Botp" Date: 2008-05-07T18:38:42+09:00 Subject: Re: Create a new file name by appending timestamp to origina From: Sunny Bogawat [mailto:sunny_bogawat@neovasolutions.com] # i want attaches a timestamps to file for this i doing # Time.now_filename # but it gives error because time has a space sum it so i need some # another mechanism using which i generate timestamps and attached to # timestamps. pardon me if i do not get you right here, but do you want something like this, eg? system "dir *testing.rb" 01/31/2003 05:55 PM 4 testing.rb 1 File(s) 4 bytes #=> true require 'fileutils' #=> true FileUtils.mv f, [Time.now.strftime("%Y-%m-%d-%H%M%S"),f].join("_") #=> 0 system "dir *testing.rb" 01/31/2003 05:55 PM 4 2008-05-07-173139_testing.rb 1 File(s) 4 bytes #=> true kind regards, -botp