FileUtils - :preserve does not preserve mtime of directories on Windoze

G

Grzegorz Chrupala

Hi Rubyists,
I have been trying to copy whole directory trees while preserving
mtime of subdirectories and file, using FileUtils.cp_r with the
:preserve option. Works as expected on Linux, but on Windows only the
mtime of files is preserved, while directories' mtime is set to
current time. Is this a bug or a limitation of Windoze?
Thanks,
 
N

nobu.nokada

Hi,

At Fri, 27 Jun 2003 19:25:25 +0900,
Grzegorz said:
I have been trying to copy whole directory trees while preserving
mtime of subdirectories and file, using FileUtils.cp_r with the
:preserve option. Works as expected on Linux, but on Windows only the
mtime of files is preserved, while directories' mtime is set to
current time. Is this a bug or a limitation of Windoze?

It works on NT series.
 
G

Grzegorz Chrupala

Hi,

At Fri, 27 Jun 2003 19:25:25 +0900,


It works on NT series.

I have tested it on three different Win2000 boxes. On one it works
fine, on two I get:

Microsoft Windows 2000 [Versión 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>ruby -v
ruby 1.8.0 (2003-05-26) [i386-mswin32]
C:\>ruby
require 'fileutils'
puts File.stat('foo').mtime
FileUtils.cp_r('foo','bar',:preserve=>true)
puts File.stat('bar').mtime
^Z
Mon Jun 30 09:27:07 Hora de verano romance 2003
Mon Jun 30 09:34:08 Hora de verano romance 2003

I guess now I should try to find out what's different in those two
cases.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top