ant - Sync Task's Overwrite Attribute Copies Identical Files -


I have encountered a problem with the sink function where files are unnecessary Is being copied from. The goal is to update everything in the $ {destination} directory with the contents of the directory $ {source} , even if the $ {file in the destination} Based on the new ant, I've added an overwritten attribute $ {destination} to ensure the overwrite is

 . & Lt; Target name = "test" & gt; & Lt; Sync todir = "$ {destination}" overwrite = "true" granulity = "5000" & gt; & Lt; Fileset dir = "$ {source}" & gt; & Lt; / Fileset & gt; & Lt; / Sync & gt; & Lt; / Target & gt;  

This action overwrites $ {destination} , but the file is always copied, even when the source and destination are the same. This leads to a lot of unnecessary traffic.

Based on the documentation, I have tried configuring the detail of the level attribute, but this effect is visible. I am also running this test between two directories on the same machine, so I do not expect the timestamp difference (definitely not more than 5 seconds).

Any thoughts about why the sync function and overwrite attribute works like this? Are there any solutions to prevent making unnecessary file copy using the default set of ant functions? After you use the overwritten = "true" sync task, you will find this behavior:

"itemprop =" text ">

You can use it with overwritten = "false", and then simultaneously follow up that only those files are existing but different, with duplicate, for example:

  & copy; Copy todir = "$ {destination}" & gt; & Lt; Fileset dir = "$ {source}" & gt; & Lt; Various TARGETDIR = "$ {destination}" ignoreFileTimes = "true" /> & Lt; / Fileset & gt; & Lt; / Copy & gt;  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -