例如:有如下两个文件夹fileset1,fileset2(空目录)
fileset1
 |—file1(修改日期2009-2-2 8:00)
 |—file2(修改日期2009-2-2 9:00)fileset2如上,fileset1中的file2为最后修改的文件。
那么如何使用Ant脚本将fileset1中的文件file2拷贝到fileset2中呢?谢谢!

解决方案 »

  1.   

    楼主真有想法建议写段script,或者独立一个程序,用ant调用
      

  2.   

    用target和copy这两个标签就可以搞定。lz去查查
      

  3.   

    写一个类处理,再写个shell脚本执行就是
      

  4.   

    <copy todir="${basedir}/fileset2">
               <fileset dir="${basedir}/fileset1">
                  <include name="file2" />
              </fileset>
    </copy>加上这个target 就可以了
      

  5.   

    <copy xxxx>
        <first count="1">
            <sort>
                 <date />
            </sort>
        </first>
    </copy>Please see 
    http://ant.apache.org/manual/copy.html
    http://ant.apache.org/manual/CoreTypes/resources.html#collection