From: Rob Biedenharn Date: 2007-03-06T23:47:39+09:00 Subject: Re: Attributing an old time stamp for a new file. On Mar 6, 2007, at 9:29 AM, ara.t.howard@noaa.gov wrote: > On Tue, 6 Mar 2007, Peter Bailey wrote: >> Hello, >> I need to read some data from some older files and put that info. >> into >> simple ASCII text files. But, I want those new text files to have the >> same time stamp as the original files that the data came from. Is >> there >> any way to do that? >> >> Thanks, >> Peter > > harp: ~> ri FileUtils.touch > -------------------------------------------------------- > FileUtils#touch > touch(list, options = {}) > ---------------------------------------------------------------------- > -- > Options: noop verbose > > Updates modification time (mtime) and access time (atime) of > file(s) in +list+. Files are created if they don't exist. > > FileUtils.touch 'timestamp' > FileUtils.touch Dir.glob('*.c'); system 'make' > > > -a > -- > be kind whenever possible... it is always possible. > - the dalai lama Unless there's a way to specify to FileUtils.touch the value of the timestamp, you can use the touch command (if you're on a sufficiently unix-like platform): touch -r oldfile newfile ...which sets the times on 'newfile' to be the same as the -r (eference) file 'oldfile' -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com