#341 copy task using created instead of modified date

0.85
closed-fixed
Tasks (408)
5
2005-04-12
2005-03-17
No

<copy> is overwriting newer files with older files
because it checks age based on created date rather
than modified date. I'm pretty sure that it should be
modified date, otherwise simply relocating a file prior to
the copy task will make the file look newer than it really
is. As an example: if you create a file, copy it elsewhere
and then go back and modify the original, copy would
not overwrite the previously copied file with the more
recently modified one.

Considering that the <touch> task is touching the
modified date, I think that <copy>'s use of the created
date is a bug rather than the intended behaviour.

File in directory:
Created: Monday, March 14, 2005, 7:31:44 PM
Modified: Monday, March 14, 2005, 7:31:35 PM
Accessed: Today, March 16, 2005, 11:12:36 AM

File overwriting it:
Created: Today, March 16, 2005, 11:23:44 AM
Modified: Monday, March 07, 2005, 12:16:11 PM
Accessed: Today, March 16, 2005, 11:23:44 AM

NAnt 0.85 (Build 0.85.1793.0; rc1; 11/28/2004)
Framework version 1.1.4322
OS Version: Win2000 Server 5.00.2195 SP4

Discussion

  • Gert Driesen

    Gert Driesen - 2005-03-18

    Logged In: YES
    user_id=707851

    Scott,

    We're definitely using the last write time (modified date) to
    check whether a certain is up-to-date.

    I've attached a build file that I used to try to reproduce this
    issue.

    Let me know if you get the same results using that build file.

    Gert

     
  • Gert Driesen

    Gert Driesen - 2005-03-18
    • assigned_to: nobody --> drieseng
    • status: open --> open-works-for-me
     
  • Gert Driesen

    Gert Driesen - 2005-03-18

    test build file

     
  • Scott Winslow

    Scott Winslow - 2005-03-21

    Logged In: YES
    user_id=86359

    You're test file worked fine, but I've attached one that shows
    what I was seeing. Sorry for not giving more info the first time
    around:

    I'm copying multiple project outputs into a single directory,
    and there is overlap because one of these projects is a
    collection of "foundation" DLLs we use in all other projects. I
    want to make sure I get the most recently compiled of each
    DLL without having to know the order the projects were most
    recently built in. Based on <copy>'s documentation, it looked
    like running it with flatten="true" was going to do exactly
    what I wanted.

    Whether it's due to the flatten operation or something to do
    with the file names matching, it doesn't seem to be acting
    right in my scenario. I did a quick peek at the source, and
    where I looked it was using the modified date, so I'm rather
    confused as well...

     
  • Scott Winslow

    Scott Winslow - 2005-03-21

    Build using flatten

     
  • Scott Winslow

    Scott Winslow - 2005-03-23
    • status: open-works-for-me --> open-remind
     
  • Gert Driesen

    Gert Driesen - 2005-04-07

    Logged In: YES
    user_id=707851

    I also get the correct results with the build file you attached,
    but I now the cause for the results you're seeing.

    I've fixed it locally, but still need to produce unit tests for it
    before I commit it to cvs.

     
  • Gert Driesen

    Gert Driesen - 2005-04-07
    • status: open-remind --> open
     
  • Gert Driesen

    Gert Driesen - 2005-04-10

    Logged In: YES
    user_id=707851

    This is now fixed in cvs.

    Let me know if the next nightly build
    (http://nant.sourceforge.net/nightly/latest) works for you.

     
  • Gert Driesen

    Gert Driesen - 2005-04-10
    • status: open --> open-fixed
     
  • Scott Winslow

    Scott Winslow - 2005-04-12

    Logged In: YES
    user_id=86359

    Confirmed fixed in nightly build. Thanks very much!

     
  • Scott Winslow

    Scott Winslow - 2005-04-12
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks