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

Discussion in 'Ruby' started by Grzegorz Chrupala, Jun 27, 2003.

  1. 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,
    --
    Grzegorz
    http://pithekos.net
     
    Grzegorz Chrupala, Jun 27, 2003
    #1
    1. Advertising

  2. Grzegorz Chrupala

    Guest

    Hi,

    At Fri, 27 Jun 2003 19:25:25 +0900,
    Grzegorz Chrupala wrote:
    > 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.

    --
    Nobu Nakada
     
    , Jun 27, 2003
    #2
    1. Advertising

  3. wrote in message news:<>...
    > Hi,
    >
    > At Fri, 27 Jun 2003 19:25:25 +0900,
    > Grzegorz Chrupala wrote:
    > > 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.


    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.
    --
    Grzegorz
    http://pithekos.net
     
    Grzegorz Chrupala, Jun 30, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugh Sasse

    File.mtime <=> DateTime.strptime()

    Hugh Sasse, Sep 8, 2005, in forum: Ruby
    Replies:
    7
    Views:
    262
    tony summerfelt
    Sep 11, 2005
  2. Axel Friedrich

    File.mtime: Bug on Windows?

    Axel Friedrich, Mar 31, 2006, in forum: Ruby
    Replies:
    0
    Views:
    172
    Axel Friedrich
    Mar 31, 2006
  3. Daniel Berger

    Problem with Net::FTP#mtime

    Daniel Berger, Aug 11, 2006, in forum: Ruby
    Replies:
    1
    Views:
    212
    James Cribbs
    Aug 11, 2006
  4. greg
    Replies:
    1
    Views:
    117
  5. John Carter
    Replies:
    3
    Views:
    74
    Sander Land
    Nov 30, 2006
Loading...

Share This Page