From: Robert Klemme Date: 2007-05-14T19:35:07+09:00 Subject: Re: FileUtils changes date of file On 14.05.2007 12:16, Peter.Meier998@gmx.de wrote: > I use ruby under WinXP and discovered the following issue. > > When I copy a file with the following code > > require 'fileutils' > FileUtils.cp("file1','file2') > > the date of the destination file won't match the date of the source > file. > It's set to the time of the copy process. But it should be the date of > the original file. > How can I get this working correct? First of all: this is expected behavior and is similar to what cp does. So this is in no way "incorrect" even though your expectation was different because Windows Explorer handles this differently. To retain meta data do FileUtils.cp("file1','file2', :preserve => true) Kind regards robert